Sha256: 3275d00b199eb5b8cf8a9ef42b05774a4e83256d7540db670232832d92e27568

Contents?: true

Size: 576 Bytes

Versions: 12

Compression:

Stored size: 576 Bytes

Contents

describe Integer, "#eban?" do
  # A006933
  @seq = [2,4,6,30,32,34,36,40,42,44,46,50,52,54,56,60,62,
          64,66,2000,2002,2004,2006,2030,2032,2034,2036,
          2040,2042,2044,2046,2050,2052,2054,2056,2060,2062,
          2064,2066,4000,4002,4004,4006,4030,4032,4034,4036,
          4040,4042,4044,4046,4050,4052,4054,4056]

  @seq.each do |n|
    it "returns true for eban number #{n}" do
      n.should be_eban
    end
  end

  @seq.to_seq.invert.sample(100).each do |n|
    it "returns false for non-eban number #{n}" do
      n.should_not be_eban
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
numb-0.186.0 spec/numb/eban_spec.rb
numb-0.185.0 spec/numb/eban_spec.rb
numb-0.184.0 spec/numb/eban_spec.rb
numb-0.181.0 spec/numb/eban_spec.rb
numb-0.170.0 spec/numb/eban_spec.rb
numb-0.152.0 spec/numb/eban_spec.rb
numb-0.138.0 spec/numb/eban_spec.rb
numb-0.125.0 spec/numb/eban_spec.rb
numb-0.114.0 spec/numb/eban_spec.rb
numb-0.111.0 spec/numb/eban_spec.rb
numb-0.109.0 spec/numb/eban_spec.rb
numb-0.99.0 spec/numb/eban_spec.rb