Sha256: 9fc0d26c41a98202136fd33f5b42e35d35ac47f7377450a988b71df9e69cd967
Contents?: true
Size: 627 Bytes
Versions: 17
Compression:
Stored size: 627 Bytes
Contents
require 'spec_helper' describe Valvat::Checksum::PL do %w(PL8567346215 PL5260211587 PL9720575348 PL5272650022).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..-4]}#{valid_vat[-1]}#{valid_vat[-2]}#{valid_vat[-3]}" it "returns false on invalid vat #{invalid_vat}" do expect(Valvat::Checksum.validate(invalid_vat)).to eql(false) end end it "returns false on special case invalid vat PL8566445330" do expect(Valvat::Checksum.validate("PL8566445330")).to eql(false) end end
Version data entries
17 entries across 17 versions & 1 rubygems