60 lines
1.6 KiB
RPMSpec
60 lines
1.6 KiB
RPMSpec
|
|
%global gem_name timecop
|
||
|
|
Summary: Provides a unified method to mock Time.now, Date.today in a single call
|
||
|
|
Name: rubygem-%{gem_name}
|
||
|
|
Version: 0.7.1
|
||
|
|
Release: 1
|
||
|
|
License: MIT
|
||
|
|
URL: https://github.com/travisjeffery/timecop
|
||
|
|
Source0: http://rubygems.org/downloads/timecop-%{version}.gem
|
||
|
|
Patch0: rubygem-timecop-0.7.1-Use-minitest.patch
|
||
|
|
BuildRequires: rubygems-devel rubygem(activesupport) rubygem(minitest) rubygem(mocha)
|
||
|
|
BuildArch: noarch
|
||
|
|
%description
|
||
|
|
A gem providing "time travel" and "time freezing" capabilities, making it dead
|
||
|
|
simple to test time-dependent code. It provides a unified method to mock
|
||
|
|
Time.now, Date.today, and DateTime.now in a single call.
|
||
|
|
|
||
|
|
%package doc
|
||
|
|
Summary: Documentation for %{name}
|
||
|
|
Requires: %{name} = %{version}-%{release}
|
||
|
|
%description doc
|
||
|
|
Documentation for %{name}.
|
||
|
|
|
||
|
|
%prep
|
||
|
|
%setup -q -c -T
|
||
|
|
%gem_install -n %{SOURCE0}
|
||
|
|
pushd .%{gem_instdir}
|
||
|
|
%patch0 -p1
|
||
|
|
popd
|
||
|
|
|
||
|
|
%build
|
||
|
|
|
||
|
|
%install
|
||
|
|
rm -rf %{buildroot}
|
||
|
|
mkdir -p %{buildroot}%{gem_dir}
|
||
|
|
cp -va ./%{gem_dir}/* %{buildroot}%{gem_dir}
|
||
|
|
chmod a+x %{buildroot}%{gem_instdir}/test/run_tests.sh
|
||
|
|
|
||
|
|
%check
|
||
|
|
pushd .%{gem_instdir}/test
|
||
|
|
sed -i '/bundler\/setup/ s/^/#/' test_helper.rb
|
||
|
|
./run_tests.sh
|
||
|
|
popd
|
||
|
|
|
||
|
|
%files
|
||
|
|
%dir %{gem_instdir}
|
||
|
|
%{gem_libdir}
|
||
|
|
%doc %{gem_instdir}/LICENSE
|
||
|
|
%doc %{gem_instdir}/README.markdown
|
||
|
|
%exclude %{gem_cache}
|
||
|
|
%{gem_spec}
|
||
|
|
|
||
|
|
%files doc
|
||
|
|
%{gem_instdir}/test
|
||
|
|
%{gem_instdir}/Rakefile
|
||
|
|
%{gem_docdir}
|
||
|
|
|
||
|
|
%changelog
|
||
|
|
* Fri Aug 7 2020 yanan li <liyanan032@huawei.com> - 0.7.1-1
|
||
|
|
- Package init
|