Sha256: 58d1f041041cc0efad4be4e42fb652d6838593d78b58c7be45ab1d80bcd0477b

Contents?: true

Size: 447 Bytes

Versions: 11

Compression:

Stored size: 447 Bytes

Contents

require 'spec_helper'

describe Valvat::Checksum::FR do
  %w(FR60528551658 FR43820567501).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
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
valvat-0.9.1 spec/valvat/checksum/fr_spec.rb
valvat-0.9.0 spec/valvat/checksum/fr_spec.rb
valvat-0.8.2 spec/valvat/checksum/fr_spec.rb
valvat-0.8.1 spec/valvat/checksum/fr_spec.rb
valvat-0.8.0 spec/valvat/checksum/fr_spec.rb
valvat-0.7.4 spec/valvat/checksum/fr_spec.rb
valvat-0.7.3 spec/valvat/checksum/fr_spec.rb
valvat-0.7.2 spec/valvat/checksum/fr_spec.rb
valvat-0.7.1 spec/valvat/checksum/fr_spec.rb
valvat-0.7.0 spec/valvat/checksum/fr_spec.rb
valvat-0.6.11 spec/valvat/checksum/fr_spec.rb