diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-05-19 01:13:34 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-05-19 01:13:34 -0300 |
commit | 72959da5edfec80b85b28aedb880ed89e9dd77d4 (patch) | |
tree | e1b8b333791d73f78b645eecc0bb036e81c21d59 /activesupport/test/core_ext/numeric_ext_test.rb | |
parent | bd262b05c133fa325a83b933b16c4c2748bfbe64 (diff) | |
parent | ed83f90d6124c4185a6d31010770e3c84d6be5fc (diff) | |
download | rails-72959da5edfec80b85b28aedb880ed89e9dd77d4.tar.gz rails-72959da5edfec80b85b28aedb880ed89e9dd77d4.tar.bz2 rails-72959da5edfec80b85b28aedb880ed89e9dd77d4.zip |
Merge pull request #20143 from vngrs/move_integer_positive_negative_to_numeric
Move Integer#positive? and Integer#negative? query methods to Numeric
Diffstat (limited to 'activesupport/test/core_ext/numeric_ext_test.rb')
-rw-r--r-- | activesupport/test/core_ext/numeric_ext_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/numeric_ext_test.rb b/activesupport/test/core_ext/numeric_ext_test.rb index b82448458d..623c64d050 100644 --- a/activesupport/test/core_ext/numeric_ext_test.rb +++ b/activesupport/test/core_ext/numeric_ext_test.rb @@ -389,4 +389,16 @@ class NumericExtFormattingTest < ActiveSupport::TestCase def test_in_milliseconds assert_equal 10_000, 10.seconds.in_milliseconds end + + def test_positive + assert 1.positive? + assert_not 0.positive? + assert_not -1.positive? + end + + def test_negative + assert(-1.negative?) + assert_not 0.negative? + assert_not 1.negative? + end end |