Permalink
Browse files

Move configuration out of spec_helper and into the fake itself. Fixes…

… error in outside apps.
  • Loading branch information...
1 parent 0a7bd0e commit 54bf4ac3598fc4c55b4332f14577628f0d48ad9b @r00k r00k committed Aug 31, 2011
Showing with 18 additions and 5 deletions.
  1. +5 −0 lib/fake_braintree.rb
  2. +12 −0 spec/fake_braintree_spec.rb
  3. +1 −5 spec/spec_helper.rb
@@ -8,6 +8,11 @@
require 'fake_braintree/sinatra_app'
require 'fake_braintree/version'
+Braintree::Configuration.environment = :production
+Braintree::Configuration.merchant_id = "xxx"
+Braintree::Configuration.public_key = "xxx"
+Braintree::Configuration.private_key = "xxx"
+
module FakeBraintree
class << self
@customers = {}
@@ -42,3 +42,15 @@
result.should be_success
end
end
+
+describe "configuration variables" do
+ it "sets the environment configuration" do
+ Braintree::Configuration.environment.should == :production
+ end
+
+ it "sets some fake API credentials" do
+ Braintree::Configuration.merchant_id.should == "xxx"
+ Braintree::Configuration.public_key.should == "xxx"
+ Braintree::Configuration.private_key.should == "xxx"
+ end
+end
View
@@ -7,11 +7,7 @@
Dir.mkdir('tmp') unless Dir.exist?('tmp')
File.new('tmp/braintree_log', 'w').close
-Braintree::Configuration.logger = Logger.new("tmp/log")
-Braintree::Configuration.environment = :production
-Braintree::Configuration.merchant_id = "xxx"
-Braintree::Configuration.public_key = "xxx"
-Braintree::Configuration.private_key = "xxx"
+Braintree::Configuration.logger = Logger.new("tmp/log")
RSpec.configure do |config|
config.mock_with :mocha

0 comments on commit 54bf4ac

Please sign in to comment.