diff options
author | Vijay Dev <vijaydev.cse@gmail.com> | 2011-11-16 02:36:36 +0530 |
---|---|---|
committer | Vijay Dev <vijaydev.cse@gmail.com> | 2011-11-16 02:36:36 +0530 |
commit | 83bf0b626cf2134260903e57d74f67de57384073 (patch) | |
tree | 662be22f6fe091499390b3ea9e0b0fda3a9f715c /activesupport/test/core_ext | |
parent | c7ab43ff062390205f1508b6476cd354a16eb362 (diff) | |
download | rails-83bf0b626cf2134260903e57d74f67de57384073.tar.gz rails-83bf0b626cf2134260903e57d74f67de57384073.tar.bz2 rails-83bf0b626cf2134260903e57d74f67de57384073.zip |
refactor test_multiple_of
Diffstat (limited to 'activesupport/test/core_ext')
-rw-r--r-- | activesupport/test/core_ext/integer_ext_test.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/activesupport/test/core_ext/integer_ext_test.rb b/activesupport/test/core_ext/integer_ext_test.rb index fe8c7eb224..b1f5f70a70 100644 --- a/activesupport/test/core_ext/integer_ext_test.rb +++ b/activesupport/test/core_ext/integer_ext_test.rb @@ -2,6 +2,8 @@ require 'abstract_unit' require 'active_support/core_ext/integer' class IntegerExtTest < Test::Unit::TestCase + PRIME = 22953686867719691230002707821868552601124472329079 + def test_multiple_of [ -7, 0, 7, 14 ].each { |i| assert i.multiple_of?(7) } [ -7, 7, 14 ].each { |i| assert ! i.multiple_of?(6) } @@ -11,10 +13,7 @@ class IntegerExtTest < Test::Unit::TestCase assert !5.multiple_of?(0) # test with a prime - assert !22953686867719691230002707821868552601124472329079.multiple_of?(2) - assert !22953686867719691230002707821868552601124472329079.multiple_of?(3) - assert !22953686867719691230002707821868552601124472329079.multiple_of?(5) - assert !22953686867719691230002707821868552601124472329079.multiple_of?(7) + [2, 3, 5, 7].each { |i| assert !PRIME.multiple_of?(i) } end def test_ordinalize |