Sha256: 1a7d495bc5b35e3048c6a5fa4bb078e696b8841d46cacae7440badd37b5bebe0
Contents?: true
Size: 665 Bytes
Versions: 20
Compression:
Stored size: 665 Bytes
Contents
describe Integer, "#refactorable?" do # A033950 REFACTORABLE = [1,2,8,9,12,18,24,36,40,56,60,72,80,84,88,96,104, 108,128,132,136,152,156,180,184,204,225,228,232, 240,248,252,276,288,296,328,344,348,360,372,376, 384,396,424,441,444,448,450,468,472,480,488,492, 504,516,536] (1..REFACTORABLE.last).each do |n| if REFACTORABLE.include?(n) it "should return true for refactorable number #{n}" do n.should be_refactorable end else it "should return false for non-refactorable number #{n}" do n.should_not be_refactorable end end end end
Version data entries
20 entries across 20 versions & 1 rubygems