Sha256: a0f095708cdd3a5cdc6cfd407a490ed3169ff3cb0f35f6ad8ce99bcfd2c02ad8
Contents?: true
Size: 759 Bytes
Versions: 17
Compression:
Stored size: 759 Bytes
Contents
require 'spec_helper' describe Valvat::Checksum::IT do %w(IT12345670785 IT01897810162 IT00197200132 IT02762750210).each do |valid_vat| it "returns true on valid vat #{valid_vat}" do expect(Valvat::Checksum.validate(valid_vat)).to eql(true) end invalid_vat = "#{valid_vat[0..-3]}#{valid_vat[-1]}#{valid_vat[-2]}" it "returns false on invalid vat #{invalid_vat}" do expect(Valvat::Checksum.validate(invalid_vat)).to eql(false) end end it "returns false on invalid special case vat IT12345671783" do expect(Valvat::Checksum.validate("IT12345671783")).to eql(false) end it "returns false on invalid special case vat IT00000000133" do expect(Valvat::Checksum.validate("IT00000000133")).to eql(false) end end
Version data entries
17 entries across 17 versions & 1 rubygems