aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activesupport/lib/active_support/core_ext/integer.rb1
-rw-r--r--activesupport/lib/active_support/core_ext/numeric.rb1
-rw-r--r--activesupport/lib/active_support/core_ext/numeric/inquiry.rb (renamed from activesupport/lib/active_support/core_ext/integer/inquiry.rb)2
-rw-r--r--activesupport/test/core_ext/integer_ext_test.rb12
-rw-r--r--activesupport/test/core_ext/numeric_ext_test.rb12
5 files changed, 14 insertions, 14 deletions
diff --git a/activesupport/lib/active_support/core_ext/integer.rb b/activesupport/lib/active_support/core_ext/integer.rb
index f5b185b42b..a44a1b4c74 100644
--- a/activesupport/lib/active_support/core_ext/integer.rb
+++ b/activesupport/lib/active_support/core_ext/integer.rb
@@ -1,4 +1,3 @@
require 'active_support/core_ext/integer/multiple'
require 'active_support/core_ext/integer/inflections'
-require 'active_support/core_ext/integer/inquiry'
require 'active_support/core_ext/integer/time'
diff --git a/activesupport/lib/active_support/core_ext/numeric.rb b/activesupport/lib/active_support/core_ext/numeric.rb
index a6bc0624be..bcdc3eace2 100644
--- a/activesupport/lib/active_support/core_ext/numeric.rb
+++ b/activesupport/lib/active_support/core_ext/numeric.rb
@@ -1,3 +1,4 @@
require 'active_support/core_ext/numeric/bytes'
require 'active_support/core_ext/numeric/time'
+require 'active_support/core_ext/numeric/inquiry'
require 'active_support/core_ext/numeric/conversions'
diff --git a/activesupport/lib/active_support/core_ext/integer/inquiry.rb b/activesupport/lib/active_support/core_ext/numeric/inquiry.rb
index 17a04d4d63..b1a27dd698 100644
--- a/activesupport/lib/active_support/core_ext/integer/inquiry.rb
+++ b/activesupport/lib/active_support/core_ext/numeric/inquiry.rb
@@ -1,4 +1,4 @@
-class Integer
+class Numeric
# Returns true if the number is positive.
#
# 1.positive? # => true
diff --git a/activesupport/test/core_ext/integer_ext_test.rb b/activesupport/test/core_ext/integer_ext_test.rb
index 883dc77a98..41736fb672 100644
--- a/activesupport/test/core_ext/integer_ext_test.rb
+++ b/activesupport/test/core_ext/integer_ext_test.rb
@@ -27,16 +27,4 @@ class IntegerExtTest < ActiveSupport::TestCase
assert_equal 'st', 1.ordinal
assert_equal 'th', 8.ordinal
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
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