Sha256: 1274dfa529b0db455c17894209d24e9b5258c0cd0c3b5405415d7caa58cbe85b

Contents?: true

Size: 589 Bytes

Versions: 30

Compression:

Stored size: 589 Bytes

Contents

describe Integer, "#vampire?" do
  # http://www.research.att.com/~njas/sequences/A014575
  VAMPIRE = [1260,1395,1435,1530,1827,2187,6880,102510,104260,
             105210,105264,105750,108135,110758,115672,116725,
             117067,118440,120600,123354,124483,125248,125433,
             125460,125500,126027,126846,129640]
  
  it "returns true for vampire numbers" do
    VAMPIRE.each do |number|
      number.should be_vampire 
    end
  end
  
  it "returns false for non-vampire numbers" do
    [1259,22,1396].each do |number|
      number.should_not be_vampire 
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
numb-0.138.0 spec/numb/vampire_spec.rb
numb-0.125.0 spec/numb/vampire_spec.rb
numb-0.114.0 spec/numb/vampire_spec.rb
numb-0.111.0 spec/numb/vampire_spec.rb
numb-0.109.0 spec/numb/vampire_spec.rb
numb-0.99.0 spec/numb/vampire_spec.rb
numb-0.96.0 spec/numb/vampire_spec.rb
numb-0.89.0 spec/numb/vampire_spec.rb
numb-0.84.0 spec/vampire_spec.rb
numb-0.77.0 spec/vampire_spec.rb
numb-0.72.1 spec/vampire_spec.rb
numb-0.72.0 spec/vampire_spec.rb
numb-0.68.0 spec/vampire_spec.rb
numb-0.63.0 spec/vampire_spec.rb
numb-0.21.0 spec/vampire_spec.rb
numb-0.20.0 spec/vampire_spec.rb
numb-0.10.0 spec/vampire_spec.rb
numb-0.9.0 spec/vampire_spec.rb
numb-0.8.0 spec/vampire_spec.rb
numb-0.7.0 spec/vampire_spec.rb