Sha256: 24f5a92efe9974d6513722359e23623a3caf06ec29d66394f6404da69eb81685

Contents?: true

Size: 567 Bytes

Versions: 5

Compression:

Stored size: 567 Bytes

Contents

require 'test_helper'

module PolishInvoicer
  class VatTest < MiniTest::Unit::TestCase
    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

5 entries across 5 versions & 1 rubygems

Version Path
polish_invoicer-0.0.5 test/vat_test.rb
polish_invoicer-0.0.4 test/vat_test.rb
polish_invoicer-0.0.3 test/vat_test.rb
polish_invoicer-0.0.2 test/vat_test.rb
polish_invoicer-0.0.1 test/vat_test.rb