Permalink
Browse files

refactor test_multiple_of

  • Loading branch information...
1 parent c7ab43f commit 83bf0b626cf2134260903e57d74f67de57384073 @vijaydev vijaydev committed Nov 15, 2011
Showing with 3 additions and 4 deletions.
  1. +3 −4 activesupport/test/core_ext/integer_ext_test.rb
@@ -2,6 +2,8 @@
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 @@ def test_multiple_of
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

0 comments on commit 83bf0b6

Please sign in to comment.