diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-09-17 16:15:25 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-09-17 16:15:25 -0300 |
commit | acda46d08181cb39d9adf56f5f983dc0ffaaf96f (patch) | |
tree | ddc361a9466d37f12ecb2392c97f806ec3a50585 /activesupport/test/core_ext | |
parent | 84087966e84a9875fdf707193f376ffea8c80610 (diff) | |
parent | 369a107c8e30a15d03cb2e85242bc604fe7a02a3 (diff) | |
download | rails-acda46d08181cb39d9adf56f5f983dc0ffaaf96f.tar.gz rails-acda46d08181cb39d9adf56f5f983dc0ffaaf96f.tar.bz2 rails-acda46d08181cb39d9adf56f5f983dc0ffaaf96f.zip |
Merge pull request #11794 from yoazt/duration-eql
Added method `#eql?` to `ActiveSupport::Duration`, in addition to `#==`.
Conflicts:
activesupport/CHANGELOG.md
activesupport/lib/active_support/duration.rb
activesupport/test/core_ext/duration_test.rb
Diffstat (limited to 'activesupport/test/core_ext')
-rw-r--r-- | activesupport/test/core_ext/duration_test.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/duration_test.rb b/activesupport/test/core_ext/duration_test.rb index 555bde6e04..881faf93f5 100644 --- a/activesupport/test/core_ext/duration_test.rb +++ b/activesupport/test/core_ext/duration_test.rb @@ -49,9 +49,13 @@ class DurationTest < ActiveSupport::TestCase "which behaves oddly for the sake of backward-compatibility." assert 1.minute.eql?(1.minute) + assert 1.minute.eql?(60.seconds) assert 2.days.eql?(48.hours) assert !1.second.eql?(1) assert !1.eql?(1.second) + assert 1.minute.eql?(180.seconds - 2.minutes) + assert !1.minute.eql?(60) + assert !1.minute.eql?('foo') end def test_inspect |