aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/duration_test.rb
diff options
context:
space:
mode:
authorlsylvester <lachlan.sylvester@hypothetical.com.au>2014-08-20 04:56:54 -0200
committerlsylvester <lachlan.sylvester@hypothetical.com.au>2014-09-15 13:59:19 +1000
commitf9767514cbdd6ef38aa62f084059776d75ed6962 (patch)
tree25d622d57c2c02921e0ef527730adc4c6d230ba6 /activesupport/test/core_ext/duration_test.rb
parenta3a8a691b2a826f19d71780b1ba9ffac15eb4f89 (diff)
downloadrails-f9767514cbdd6ef38aa62f084059776d75ed6962.tar.gz
rails-f9767514cbdd6ef38aa62f084059776d75ed6962.tar.bz2
rails-f9767514cbdd6ef38aa62f084059776d75ed6962.zip
add implementation of respond_to? for ActiveSupport::Duration
Diffstat (limited to 'activesupport/test/core_ext/duration_test.rb')
-rw-r--r--activesupport/test/core_ext/duration_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/duration_test.rb b/activesupport/test/core_ext/duration_test.rb
index a89202f518..555bde6e04 100644
--- a/activesupport/test/core_ext/duration_test.rb
+++ b/activesupport/test/core_ext/duration_test.rb
@@ -40,6 +40,10 @@ class DurationTest < ActiveSupport::TestCase
assert !(1.day == 'foo')
end
+ def test_to_s
+ assert_equal "1", 1.second.to_s
+ end
+
def test_eql
rubinius_skip "Rubinius' #eql? definition relies on #instance_of? " \
"which behaves oddly for the sake of backward-compatibility."
@@ -183,4 +187,9 @@ class DurationTest < ActiveSupport::TestCase
cased = case 1.day when 1.day then "ok" end
assert_equal cased, "ok"
end
+
+ def test_respond_to
+ assert_respond_to 1.day, :since
+ assert_respond_to 1.day, :zero?
+ end
end