Sha256: 4272b75d482640e729694d39df7f63096262fbf6139e64f44f2266f016f0ab2f

Contents?: true

Size: 530 Bytes

Versions: 3

Compression:

Stored size: 530 Bytes

Contents

require 'test/unit'
require 'big_money'

class TestExchange < Test::Unit::TestCase
  def setup
    @aud = BigMoney.currency(:aud)
    @usd = BigMoney.currency(:usd)
  end

  def test_rate
    assert_kind_of BigDecimal, BigMoney::Exchange.rate(@aud, @usd)
    assert_kind_of BigDecimal, BigMoney::Exchange.rate(:aud, :usd)
    assert_raise BigMoney::UnknownCurrency do
      BigMoney::Exchange.rate(:aud, :fud)
    end
  end

  def test_equal_rate
    assert_equal BigDecimal(1.to_s), BigMoney::Exchange.rate(:usd, :usd)
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
mroch-BigMoney-0.2.1 test/test_exchange.rb
shanna-big_money-0.2.1 test/test_exchange.rb
shanna-big_money-0.2.2 test/test_exchange.rb