From 7988e420767928bc4bde419bcd952a7234c2b184 Mon Sep 17 00:00:00 2001 From: Rafael Lima Date: Thu, 26 Sep 2013 19:47:20 -0300 Subject: [PATCH] MissingConfigExecption => MissingConfigExeception --- README.md | 2 +- lib/bitstamp.rb | 4 ++-- spec/bitstamp_spec.rb | 11 ++++++++--- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f3c31b1..9120593 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Bitstamp.setup do |config| end ``` -If you fail to set your `key` or `secret` a `MissingConfigExecption` +If you fail to set your `key` or `secret` a `MissingConfigExeception` will be raised. ## Bitstamp ticker diff --git a/lib/bitstamp.rb b/lib/bitstamp.rb index 37e15e3..cd0d8ce 100644 --- a/lib/bitstamp.rb +++ b/lib/bitstamp.rb @@ -57,9 +57,9 @@ def self.setup def self.sanity_check! unless self.key || self.secret - raise MissingConfigExecption.new("Bitstamp Gem not properly configured") + raise MissingConfigExeception.new("Bitstamp Gem not properly configured") end end - class MissingConfigExecption"0", "fee"=>"0.4000", "btc_available"=>"0", "usd_reserved"=>"0", "btc_balance"=>"0", "usd_balance"=>"6953.07", "usd_available"=>"6953.07"} } + context "configured" do + subject { Bitstamp.balance } + before { setup_bitstamp } + it { should == {"btc_reserved"=>"0", "fee"=>"0.4000", "btc_available"=>"0", "usd_reserved"=>"0", "btc_balance"=>"0", "usd_balance"=>"6953.07", "usd_available"=>"6953.07"} } + end + context "not configured" do + it { expect { Bitstamp.balance }.to raise_exception(Bitstamp::MissingConfigExeception, "Bitstamp Gem not properly configured") } + end end describe :order_book, vcr: {cassette_name: 'bitstamp/order_book'} do