Sha256: 125fff411defb306d29bc6d37b9149c625e4991b6a41179d86fe7c94531642ae

Contents?: true

Size: 450 Bytes

Versions: 2

Compression:

Stored size: 450 Bytes

Contents

$:.unshift(File.dirname(__FILE__) + '../lib')

require 'test/unit'
require 'stick/currency'

class TestUnits < Test::Unit::TestCase

  include ::Stick::Units

  def test_typerror
    assert_raises(TypeError) do
      assert_equal(1.usd,  1.try.to(:usd))
    end
  end

  def test_cex
    e = 1.twd().unit
    r = 1.usd(:cex).to(twd(:cex))
    assert_equal( e, r.unit )
  end

  def test_usd_to_tws
    assert_equal( 1.tws, 1.usd.to(tws) )
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
stick-1.3.0 test/test_currency.rb
stick-1.3.1 test/test_currency.rb