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

Version Path
numb-0.186.0 spec/numb/refactorable_spec.rb
numb-0.185.0 spec/numb/refactorable_spec.rb
numb-0.184.0 spec/numb/refactorable_spec.rb
numb-0.181.0 spec/numb/refactorable_spec.rb
numb-0.170.0 spec/numb/refactorable_spec.rb
numb-0.152.0 spec/numb/refactorable_spec.rb
numb-0.138.0 spec/numb/refactorable_spec.rb
numb-0.125.0 spec/numb/refactorable_spec.rb
numb-0.114.0 spec/numb/refactorable_spec.rb
numb-0.111.0 spec/numb/refactorable_spec.rb
numb-0.109.0 spec/numb/refactorable_spec.rb
numb-0.99.0 spec/numb/refactorable_spec.rb
numb-0.96.0 spec/numb/refactorable_spec.rb
numb-0.89.0 spec/numb/refactorable_spec.rb
numb-0.84.0 spec/refactorable_spec.rb
numb-0.77.0 spec/refactorable_spec.rb
numb-0.72.1 spec/refactorable_spec.rb
numb-0.72.0 spec/refactorable_spec.rb
numb-0.68.0 spec/refactorable_spec.rb
numb-0.63.0 spec/refactorable_spec.rb