Sha256: 00328cf8c74e19af9736efd1f6dc1f4d35c19a59c97bb0358c9f0d68166f2893
Contents?: true
Size: 571 Bytes
Versions: 11
Compression:
Stored size: 571 Bytes
Contents
# frozen_string_literal: true require 'spec_helper' describe Valvat::Checksum::BG do %w[BG123456786 BG926067143 BG926067770 BG0101011739 BG0121013021 BG5041019992 BG1521687837 BG1431889037].each do |valid_vat| it "returns true on valid VAT #{valid_vat}" do expect(Valvat::Checksum.validate(valid_vat)).to be(true) end invalid_vat = "#{valid_vat[0..-4]}#{valid_vat[-1]}#{valid_vat[-2]}#{valid_vat[-4]}" it "returns false on invalid VAT #{invalid_vat}" do expect(Valvat::Checksum.validate(invalid_vat)).to be(false) end end end
Version data entries
11 entries across 11 versions & 1 rubygems