diff --git a/rubygem-timecop-failed-assert-fix.patch b/rubygem-timecop-failed-assert-fix.patch new file mode 100644 index 0000000..9b6acff --- /dev/null +++ b/rubygem-timecop-failed-assert-fix.patch @@ -0,0 +1,80 @@ +*** test/test_time_stack_item.rb 2010-10-14 13:41:21.951740293 +0200 +--- test/test_time_stack_item.rb.new 2010-10-14 13:50:04.133696011 +0200 +*************** +*** 97,105 **** + Timecop.freeze(DateTime.parse("2009-10-1 00:38:00 -0400")) + t = DateTime.parse("2009-10-11 00:00:00 -0400") + tsi = Timecop::TimeStackItem.new(:freeze, t) +! assert Time.now.dst?, "precondition" +! assert tsi.time.dst?, "precondition" +! assert_equal 0, tsi.send(:dst_adjustment) + end + + def test_compute_dst_adjustment_for_non_dst_to_non_dst +--- 97,105 ---- + Timecop.freeze(DateTime.parse("2009-10-1 00:38:00 -0400")) + t = DateTime.parse("2009-10-11 00:00:00 -0400") + tsi = Timecop::TimeStackItem.new(:freeze, t) +! #assert Time.now.dst?, "precondition" +! #assert tsi.time.dst?, "precondition" +! #assert_equal 0, tsi.send(:dst_adjustment) + end + + def test_compute_dst_adjustment_for_non_dst_to_non_dst +*************** +*** 115,123 **** + Timecop.freeze(DateTime.parse("2009-10-1 00:38:00 -0400")) + t = DateTime.parse("2009-12-11 00:00:00 -0400") + tsi = Timecop::TimeStackItem.new(:freeze, t) +! assert Time.now.dst?, "precondition" +! assert !tsi.time.dst?, "precondition" +! assert_equal 60 * 60, tsi.send(:dst_adjustment) + end + + def test_compute_dst_adjustment_for_non_dst_to_dst +--- 115,123 ---- + Timecop.freeze(DateTime.parse("2009-10-1 00:38:00 -0400")) + t = DateTime.parse("2009-12-11 00:00:00 -0400") + tsi = Timecop::TimeStackItem.new(:freeze, t) +! #assert Time.now.dst?, "precondition" +! #assert !tsi.time.dst?, "precondition" +! #assert_equal 60 * 60, tsi.send(:dst_adjustment) + end + + def test_compute_dst_adjustment_for_non_dst_to_dst +*************** +*** 125,132 **** + t = DateTime.parse("2009-10-11 00:00:00 -0400") + tsi = Timecop::TimeStackItem.new(:freeze, t) + assert !Time.now.dst?, "precondition" +! assert tsi.time.dst?, "precondition" +! assert_equal -1 * 60 * 60, tsi.send(:dst_adjustment) + end + + # Ensure DateTime's handle changing DST properly +--- 125,132 ---- + t = DateTime.parse("2009-10-11 00:00:00 -0400") + tsi = Timecop::TimeStackItem.new(:freeze, t) + assert !Time.now.dst?, "precondition" +! #assert tsi.time.dst?, "precondition" +! #assert_equal -1 * 60 * 60, tsi.send(:dst_adjustment) + end + + # Ensure DateTime's handle changing DST properly +*************** +*** 136,142 **** + tsi = Timecop::TimeStackItem.new(:freeze, t) + assert_date_times_equal t, tsi.datetime + # verify Date also 'moves backward' an hour to change the day +! assert_equal Date.new(2009, 10, 10), tsi.date + end + + def test_datetime_for_non_dst_to_dst +--- 136,142 ---- + tsi = Timecop::TimeStackItem.new(:freeze, t) + assert_date_times_equal t, tsi.datetime + # verify Date also 'moves backward' an hour to change the day +! #assert_equal Date.new(2009, 10, 10), tsi.date + end + + def test_datetime_for_non_dst_to_dst diff --git a/rubygem-timecop.spec b/rubygem-timecop.spec index 36aaa91..be612de 100644 --- a/rubygem-timecop.spec +++ b/rubygem-timecop.spec @@ -1,23 +1,21 @@ -%global gemdir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null) -%global gemname timecop -%global geminstdir %{gemdir}/gems/%{gemname}-%{version} -%global rubyabi 1.8 +%global gem_name timecop +%global rubyabi 1.9.1 Summary: Provides a unified method to mock Time.now, Date.today in a single call -Name: rubygem-%{gemname} +Name: rubygem-%{gem_name} Version: 0.3.5 -Release: 4%{?dist} +Release: 5%{?dist} Group: Development/Languages License: MIT URL: http://github.com/jtrupiano/timecop -Source0: http://rubygems.org/downloads/%{gemname}-%{version}.gem +Source0: http://rubygems.org/downloads/%{gem_name}-%{version}.gem Patch0: %{name}-failed-assert-fix.patch Requires: ruby(abi) = %{rubyabi} -Requires: rubygems -BuildRequires: rubygems -BuildRequires: rubygem(test-unit) +Requires: ruby(rubygems) +BuildRequires: rubygems-devel +BuildRequires: rubygem(minitest) BuildArch: noarch -Provides: rubygem(%{gemname}) = %{version} +Provides: rubygem(%{gem_name}) = %{version} %description A gem providing "time travel" and "time freezing" capabilities, making it dead @@ -34,13 +32,13 @@ Documentation for %{name} %prep %setup -q -c -T -mkdir -p ./%{gemdir} +mkdir -p ./%{gem_dir} gem install \ --local \ - --install-dir ./%{gemdir} \ + --install-dir ./%{gem_dir} \ -V --force --rdoc \ %{SOURCE0} -pushd .%{geminstdir} +pushd .%{gem_instdir} %patch0 popd @@ -48,13 +46,13 @@ popd %install rm -rf %{buildroot} -mkdir -p %{buildroot}%{gemdir} -cp -va ./%{gemdir}/* %{buildroot}%{gemdir} +mkdir -p %{buildroot}%{gem_dir} +cp -va ./%{gem_dir}/* %{buildroot}%{gem_dir} %check -pushd %{buildroot}/%{geminstdir}/test +pushd %{buildroot}/%{gem_instdir}/test mv test_time_stack_item.rb disabled_test_time_stack_item.rb -%_bindir/ruby -I../lib test_time*.rb +%_bindir/ruby -I../lib:. test_time*.rb mv disabled_test_time_stack_item.rb test_time_stack_item.rb popd @@ -63,22 +61,25 @@ rm -rf %{buildroot} %files %defattr(-, root, root, -) -%dir %{geminstdir} -%{geminstdir}/lib -%doc %{geminstdir}/LICENSE -%doc %{geminstdir}/README.rdoc -%doc %{geminstdir}/History.rdoc -%doc %{geminstdir}/VERSION.yml -%{gemdir}/cache/%{gemname}-%{version}.gem -%{gemdir}/specifications/%{gemname}-%{version}.gemspec +%dir %{gem_instdir} +%{gem_libdir} +%doc %{gem_instdir}/LICENSE +%doc %{gem_instdir}/README.rdoc +%doc %{gem_instdir}/History.rdoc +%doc %{gem_instdir}/VERSION.yml +%{gem_cache} +%{gem_spec} %files doc %defattr(-, root, root, -) -%{geminstdir}/test -%{geminstdir}/Rakefile -%{gemdir}/doc/%{gemname}-%{version} +%{gem_instdir}/test +%{gem_instdir}/Rakefile +%{gem_docdir} %changelog +* Thu Feb 02 2012 Vít Ondruch - 0.3.5-5 +- Rebuilt for Ruby 1.9.3. + * Sat Jan 14 2012 Fedora Release Engineering - 0.3.5-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild diff --git a/sources b/sources index 545b2ab..adda0ab 100644 --- a/sources +++ b/sources @@ -1,2 +1 @@ -41f2cd015c3e382456dcb21ab9256eba rubygem-timecop-failed-assert-fix.patch d2043669f11eca7fabaa0b222250b942 timecop-0.3.5.gem