diff --git a/spec/bitstamp_spec.rb b/spec/bitstamp_spec.rb index 0a72ec7..8642333 100644 --- a/spec/bitstamp_spec.rb +++ b/spec/bitstamp_spec.rb @@ -34,7 +34,7 @@ end describe :balance, vcr: {cassette_name: 'bitstamp/balance'} do - before { read_bitstamp_yaml } + before { setup_bitstamp } subject { Bitstamp.balance } 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 diff --git a/spec/orders_spec.rb b/spec/orders_spec.rb index 2ff790d..86894dc 100644 --- a/spec/orders_spec.rb +++ b/spec/orders_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Bitstamp::Orders do - before { read_bitstamp_yaml } + before { setup_bitstamp } describe :all, vcr: {cassette_name: 'bitstamp/orders/all'} do subject { Bitstamp.orders.all } diff --git a/spec/support/bitstamp_setup.rb b/spec/support/bitstamp_setup.rb index aa854f0..951b4ef 100644 --- a/spec/support/bitstamp_setup.rb +++ b/spec/support/bitstamp_setup.rb @@ -8,7 +8,7 @@ end end -def read_bitstamp_yaml +def setup_bitstamp Bitstamp.setup do |config| raise "You must set environment variable BITSTAMP_KEY and BITSTAMP_SECRET with your username and password to run specs." if ENV['BITSTAMP_KEY'].nil? or ENV['BITSTAMP_SECRET'].nil? config.key = ENV['BITSTAMP_KEY'] diff --git a/spec/transactions_spec.rb b/spec/transactions_spec.rb index 46b63d9..2b50b1b 100644 --- a/spec/transactions_spec.rb +++ b/spec/transactions_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Bitstamp::UserTransactions do - before { read_bitstamp_yaml } + before { setup_bitstamp } describe :all, vcr: {cassette_name: 'bitstamp/user_transactions/all'} do subject { Bitstamp.user_transactions.all }