Sha256: eea10e705e5f83d55d7bde6f9e1fbe05445c8b1bfa790d10ac21a5c963d76790

Contents?: true

Size: 567 Bytes

Versions: 6

Compression:

Stored size: 567 Bytes

Contents

require 'spec_helper'

describe Valvat::Checksum::ES do
  %w(ESA13585625 ESB83871236 ESE54507058 ES25139013J ESQ1518001A ESQ5018001G ESX4942978W ESX7676464F ESB10317980).each do |valid_vat|
    it "returns true on valid vat #{valid_vat}" do
      Valvat::Checksum.validate(valid_vat).should eql(true)
    end

    invalid_vat = "#{valid_vat[0..-6]}#{valid_vat[-2]}#{valid_vat[-5]}#{valid_vat[-4]}#{valid_vat[-3]}#{valid_vat[-1]}"

    it "returns false on invalid vat #{invalid_vat}" do
      Valvat::Checksum.validate(invalid_vat).should eql(false)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
valvat-0.6.4 spec/valvat/checksum/es_spec.rb
valvat-0.6.3 spec/valvat/checksum/es_spec.rb
valvat-0.6.2 spec/valvat/checksum/es_spec.rb
valvat-0.6.1 spec/valvat/checksum/es_spec.rb
valvat-0.6.0 spec/valvat/checksum/es_spec.rb
valvat-0.5.0 spec/valvat/checksum/es_spec.rb