Sha256: 57e6674c93d6eb0876ec4c82fd59dad5a5be645c50af120f2cf78d81c4043fcb

Contents?: true

Size: 444 Bytes

Versions: 2

Compression:

Stored size: 444 Bytes

Contents

require 'spec_helper'

describe Valvat::Checksum::HR do
  %w(HR06282943396 HR17099025134).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..-3]}#{valid_vat[-1]}#{valid_vat[-2]}"

    it "returns false on invalid VAT #{invalid_vat}" do
      expect(Valvat::Checksum.validate(invalid_vat)).to be false
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
valvat-1.0.1 spec/valvat/checksum/hr_spec.rb
valvat-1.0.0 spec/valvat/checksum/hr_spec.rb