Sha256: 138316cdabf56331515323813751024ad79b106aa4b7deb1b8a59f78a68d6676

Contents?: true

Size: 479 Bytes

Versions: 17

Compression:

Stored size: 479 Bytes

Contents

require 'spec_helper'

describe Valvat::Checksum::LU do
  %w(LU13669580 LU25361352 LU23124018 LU17560609).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..-4]}#{valid_vat[-2]}#{valid_vat[-3]}#{valid_vat[-1]}"

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

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
valvat-0.9.1 spec/valvat/checksum/lu_spec.rb
valvat-0.9.0 spec/valvat/checksum/lu_spec.rb
valvat-0.8.2 spec/valvat/checksum/lu_spec.rb
valvat-0.8.1 spec/valvat/checksum/lu_spec.rb
valvat-0.8.0 spec/valvat/checksum/lu_spec.rb
valvat-0.7.4 spec/valvat/checksum/lu_spec.rb
valvat-0.7.3 spec/valvat/checksum/lu_spec.rb
valvat-0.7.2 spec/valvat/checksum/lu_spec.rb
valvat-0.7.1 spec/valvat/checksum/lu_spec.rb
valvat-0.7.0 spec/valvat/checksum/lu_spec.rb
valvat-0.6.11 spec/valvat/checksum/lu_spec.rb
valvat-0.6.10 spec/valvat/checksum/lu_spec.rb
valvat-0.6.9 spec/valvat/checksum/lu_spec.rb
valvat-0.6.8 spec/valvat/checksum/lu_spec.rb
valvat-0.6.7 spec/valvat/checksum/lu_spec.rb
valvat-0.6.6 spec/valvat/checksum/lu_spec.rb
valvat-0.6.5 spec/valvat/checksum/lu_spec.rb