aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2013-05-10 14:10:10 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2013-05-10 14:10:10 -0300
commit0be27b709bd62a2dc5c8998adbfd993ec06790ac (patch)
treee0b580c2efec0c72469e1146fe9d6dcf9fedc606 /actionpack/test
parenta59d661a82e684e23fd7295443e5d1264315df2e (diff)
downloadrails-0be27b709bd62a2dc5c8998adbfd993ec06790ac.tar.gz
rails-0be27b709bd62a2dc5c8998adbfd993ec06790ac.tar.bz2
rails-0be27b709bd62a2dc5c8998adbfd993ec06790ac.zip
So not make Fixnum#/ private on Ruby verions less than 1.9.3
In those version to_date call Fixnum#/, what will cause a failure
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/template/date_helper_test.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/actionpack/test/template/date_helper_test.rb b/actionpack/test/template/date_helper_test.rb
index 50c7892ad0..ad46ff4429 100644
--- a/actionpack/test/template/date_helper_test.rb
+++ b/actionpack/test/template/date_helper_test.rb
@@ -19,7 +19,7 @@ class DateHelperTest < ActionView::TestCase
end
def assert_distance_of_time_in_words(from, to=nil)
- Fixnum.send :private, :/ # test we avoid Integer#/ (redefined by mathn)
+ Fixnum.send(:private, :/) if RUBY_VERSION >= '1.9.3' # test we avoid Integer#/ (redefined by mathn)
to ||= from
@@ -98,9 +98,8 @@ class DateHelperTest < ActionView::TestCase
# test to < from
assert_equal "about 4 hours", distance_of_time_in_words(from + 4.hours, to)
assert_equal "less than 20 seconds", distance_of_time_in_words(from + 19.seconds, to, true)
-
- ensure
- Fixnum.send :public, :/
+ ensure
+ Fixnum.send(:public, :/) if RUBY_VERSION >= '1.9.3'
end
def test_distance_in_words