Sha256: 8397cdfdefe58c78d3fca438e0a3a5f2cefa8d9e5f9029f94d5ba629deaff4df

Contents?: true

Size: 547 Bytes

Versions: 11

Compression:

Stored size: 547 Bytes

Contents

describe Integer, "#iban?" do
  # A089589
  @seq = [0,1,2,3,4,7,10,11,12,14,17,20,21,22,23,24,27,40,
          41,42,43,44,47,70,71,72,73,74,77,100,101,102,103,
          104,107,110,111,112,114,117,120,121,122,123,124,
          127,140,141,142,143,144,147,170,171,172,173,174,
          177,200,201]

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

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

Version data entries

11 entries across 11 versions & 1 rubygems

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