Sha256: 53c0e42da9af1e2c3b80053a2ce5cdf54f13d129c495e93c967376de08ea3f7f

Contents?: true

Size: 557 Bytes

Versions: 14

Compression:

Stored size: 557 Bytes

Contents

require 'test_helper'

module PolishInvoicer
  class VatTest < Minitest::Test
    def test_valid
      assert Vat.valid?(23)
      assert Vat.valid?(0)
      assert Vat.valid?(-1)
      assert_equal false, Vat.valid?(123)
      assert_equal false, Vat.valid?(-10)
      assert_equal false, Vat.valid?('test')
    end

    def test_zw
      assert Vat.zw?(-1)
      assert_equal false, Vat.zw?(23)
    end

    def test_to_s
      assert_equal '23%', Vat.to_s(23)
      assert_equal '0%', Vat.to_s(0)
      assert_equal 'zw.', Vat.to_s(-1)
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
polish_invoicer-0.0.19 test/vat_test.rb
polish_invoicer-0.0.18 test/vat_test.rb
polish_invoicer-0.0.17 test/vat_test.rb
polish_invoicer-0.0.16 test/vat_test.rb
polish_invoicer-0.0.15 test/vat_test.rb
polish_invoicer-0.0.14 test/vat_test.rb
polish_invoicer-0.0.13 test/vat_test.rb
polish_invoicer-0.0.12 test/vat_test.rb
polish_invoicer-0.0.11 test/vat_test.rb
polish_invoicer-0.0.10 test/vat_test.rb
polish_invoicer-0.0.9 test/vat_test.rb
polish_invoicer-0.0.8 test/vat_test.rb
polish_invoicer-0.0.7 test/vat_test.rb
polish_invoicer-0.0.6 test/vat_test.rb