2020-08-20 17:14:54 +08:00
|
|
|
%global gem_name timecop
|
|
|
|
|
Summary: Provides a unified method to mock Time.now, Date.today in a single call
|
|
|
|
|
Name: rubygem-%{gem_name}
|
2022-07-20 17:00:53 +08:00
|
|
|
Version: 0.9.5
|
2020-08-20 17:14:54 +08:00
|
|
|
Release: 1
|
|
|
|
|
License: MIT
|
|
|
|
|
URL: https://github.com/travisjeffery/timecop
|
|
|
|
|
Source0: http://rubygems.org/downloads/timecop-%{version}.gem
|
|
|
|
|
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
|
2022-07-20 17:00:53 +08:00
|
|
|
%setup -q -n %{gem_name}-%{version}
|
2020-08-20 17:14:54 +08:00
|
|
|
|
|
|
|
|
%build
|
2022-07-20 17:00:53 +08:00
|
|
|
gem build ../%{gem_name}-%{version}.gemspec
|
|
|
|
|
%gem_install
|
2020-08-20 17:14:54 +08:00
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
rm -rf %{buildroot}
|
|
|
|
|
mkdir -p %{buildroot}%{gem_dir}
|
|
|
|
|
cp -va ./%{gem_dir}/* %{buildroot}%{gem_dir}
|
|
|
|
|
|
|
|
|
|
%check
|
2022-07-20 17:00:53 +08:00
|
|
|
pushd .%{gem_instdir}/
|
|
|
|
|
# Drop Bundler and minitest-rg dependency.
|
|
|
|
|
sed -i \
|
|
|
|
|
-e '/require..bundler\/setup./ s/^/#/' \
|
|
|
|
|
-e '/require..minitest\/rg./ s/^/#/' \
|
|
|
|
|
-e '/require .pry./ s/^/#/g' \
|
|
|
|
|
test/test_helper.rb
|
|
|
|
|
|
|
|
|
|
# The test cases must be executed independently.
|
|
|
|
|
for i in test/*_test.rb; do
|
|
|
|
|
ruby -I.:lib ${i}
|
|
|
|
|
done
|
2020-08-20 17:14:54 +08:00
|
|
|
popd
|
|
|
|
|
|
|
|
|
|
%files
|
|
|
|
|
%dir %{gem_instdir}
|
2022-07-20 17:00:53 +08:00
|
|
|
%license %{gem_instdir}/LICENSE
|
2020-08-20 17:14:54 +08:00
|
|
|
%{gem_libdir}
|
|
|
|
|
%doc %{gem_instdir}/README.markdown
|
|
|
|
|
%exclude %{gem_cache}
|
|
|
|
|
%{gem_spec}
|
|
|
|
|
|
|
|
|
|
%files doc
|
|
|
|
|
%{gem_instdir}/test
|
|
|
|
|
%{gem_instdir}/Rakefile
|
|
|
|
|
%{gem_docdir}
|
|
|
|
|
|
|
|
|
|
%changelog
|
2022-07-20 17:00:53 +08:00
|
|
|
* Wed Jul 20 2022 wangkai <wangkai385@h-partners.com> - 0.9.5-1
|
|
|
|
|
- Update to 0.9.5
|
|
|
|
|
|
2020-08-20 17:14:54 +08:00
|
|
|
* Fri Aug 7 2020 yanan li <liyanan032@huawei.com> - 0.7.1-1
|
|
|
|
|
- Package init
|