aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/core_ext/fixnum_ext_test.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/fixnum_ext_test.rb b/activesupport/test/core_ext/fixnum_ext_test.rb
new file mode 100644
index 0000000000..627c282b8b
--- /dev/null
+++ b/activesupport/test/core_ext/fixnum_ext_test.rb
@@ -0,0 +1,14 @@
+require 'test/unit'
+require File.dirname(__FILE__) + '/../../lib/active_support/core_ext/fixnum'
+
+class FixnumExtTest < Test::Unit::TestCase
+ def test_even
+ assert [ -2, 0, 2, 4 ].all? { |i| i.even? }
+ assert ![ -1, 1, 3 ].all? { |i| i.even? }
+ end
+
+ def test_odd
+ assert ![ -2, 0, 2, 4 ].all? { |i| i.odd? }
+ assert [ -1, 1, 3 ].all? { |i| i.odd? }
+ end
+end