aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/date_helper_test.rb
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2012-11-14 20:05:09 -0800
committerRafael Mendonça França <rafaelmfranca@gmail.com>2012-11-14 20:05:09 -0800
commitf732f9b7b822c9806cf3e07f127d0771b815500b (patch)
tree4736ab2134a91847559071e9430f7797e9b753e9 /actionpack/test/template/date_helper_test.rb
parentbff4d8d165486797227c5933e93a62e7f2c15d98 (diff)
parentdc3ac357dc21c8ba05de95760da2b2c9f963012e (diff)
downloadrails-f732f9b7b822c9806cf3e07f127d0771b815500b.tar.gz
rails-f732f9b7b822c9806cf3e07f127d0771b815500b.tar.bz2
rails-f732f9b7b822c9806cf3e07f127d0771b815500b.zip
Merge pull request #8222 from marcandre/avoid_slash
Avoid using Integer#/, as it is redefined by the 'mathn' stdlib
Diffstat (limited to 'actionpack/test/template/date_helper_test.rb')
-rw-r--r--actionpack/test/template/date_helper_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/actionpack/test/template/date_helper_test.rb b/actionpack/test/template/date_helper_test.rb
index 8bd8eff3c0..f9ce63fcb0 100644
--- a/actionpack/test/template/date_helper_test.rb
+++ b/actionpack/test/template/date_helper_test.rb
@@ -19,6 +19,8 @@ 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)
+
to ||= from
# 0..1 minute with :include_seconds => true
@@ -121,6 +123,9 @@ class DateHelperTest < ActionView::TestCase
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, :include_seconds => true)
assert_equal "less than a minute", distance_of_time_in_words(from + 19.seconds, to, :include_seconds => false)
+
+ ensure
+ Fixnum.send :public, :/
end
def test_distance_in_words