Sha256: 6ff4ed90ced37852668d55b6ab76cabb461e49143b71cf0d28921ca2f95b1659

Contents?: true

Size: 480 Bytes

Versions: 11

Compression:

Stored size: 480 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

describe Valvat::Checksum::HU do
  %w[HU10672101 HU13460370 HU10747759].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

11 entries across 11 versions & 1 rubygems

Version Path
valvat-1.4.1 spec/valvat/checksum/hu_spec.rb
valvat-1.4.0 spec/valvat/checksum/hu_spec.rb
valvat-1.3.0 spec/valvat/checksum/hu_spec.rb
valvat-1.2.1 spec/valvat/checksum/hu_spec.rb
valvat-1.2.0 spec/valvat/checksum/hu_spec.rb
valvat-1.1.5 spec/valvat/checksum/hu_spec.rb
valvat-1.1.4 spec/valvat/checksum/hu_spec.rb
valvat-1.1.3 spec/valvat/checksum/hu_spec.rb
valvat-1.1.2 spec/valvat/checksum/hu_spec.rb
valvat-1.1.1 spec/valvat/checksum/hu_spec.rb
valvat-1.1.0 spec/valvat/checksum/hu_spec.rb