Sha256: 9e228b2acc56b43098cf6a8decb08b1a6c6ee153163d12612616969206588d04

Contents?: true

Size: 601 Bytes

Versions: 1

Compression:

Stored size: 601 Bytes

Contents

require "tannenbaum"

describe Tannenbaum do
  describe Tannenbaum::Quote do
    it "shows the current exchange rates and timestamp for a given currency" do
      quotation = Tannenbaum::Quote.new(:USD)
      
      exchange_rates = quotation.ask

      exchange_rates.sell.should be_a(Float)
      exchange_rates.buy.should be_a(Float)
      
      exchange_rates.timestamp.should be_a(DateTime)
    end

    it "fails when trying to quote a non-existant currency" do
      expect { Tannenbaum::Quote.new(:ANT) }.to raise_exception(Tannenbaum::Exceptions::InvalidCurrencyException)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tannenbaum-0.0.1 spec/tannenbaum_spec.rb