spec/spec_helper.rb in balanced-0.3.11 vs spec/spec_helper.rb in balanced-0.5.1
- old
+ new
@@ -13,11 +13,29 @@
VCR.configure do |c|
c.cassette_library_dir = 'spec/cassettes'
c.hook_into :faraday
end
+# TODO: better way to do this?
+host = ENV['BALANCED_HOST'] or nil
+options = {}
+if !host.nil? then
+ options[:scheme] = 'http'
+ options[:host] = host
+ options[:port] = 5000
+ options[:ssl_verify] = false
+ Balanced.configure(nil, options)
+end
+
RSpec.configure do |c|
c.extend VCR::RSpec::Macros
+
+ # @return [Balanced::Marketplace]
+ def make_marketplace
+ api_key = Balanced::ApiKey.new.save
+ Balanced.configure api_key.secret
+ Balanced::Marketplace.new.save
+ end
end
ACCOUNTS_URI_REGEX = /\/v1\/marketplaces\/TEST-\w*\/accounts/
MERCHANT_URI_REGEX = /\/v1\/marketplaces\/TEST-\w*\/accounts\/\w*/