spec/unit/braintree/configuration_spec.rb in braintree-1.0.1 vs spec/unit/braintree/configuration_spec.rb in braintree-1.1.0

- old
+ new

@@ -1,23 +1,23 @@ require File.dirname(__FILE__) + "/../spec_helper" describe Braintree::Configuration do - + before do @original_merchant_id = Braintree::Configuration.merchant_id @original_public_key = Braintree::Configuration.public_key @original_private_key = Braintree::Configuration.private_key @original_environment = Braintree::Configuration.environment end after do Braintree::Configuration.merchant_id = @original_merchant_id - Braintree::Configuration.public_key = @original_public_key + Braintree::Configuration.public_key = @original_public_key Braintree::Configuration.private_key = @original_private_key Braintree::Configuration.environment = @original_environment end - + describe "self.base_merchant_path" do it "returns /merchants/{merchant_id}" do Braintree::Configuration.base_merchant_path.should == "/merchants/integration_merchant_id" end end @@ -68,19 +68,19 @@ expect do Braintree::Configuration.environment end.to raise_error(Braintree::ConfigurationError, "Braintree::Configuration.environment needs to be set") end end - + describe "self.environment=" do it "raises an exception if the environment is invalid" do expect do Braintree::Configuration.environment = :invalid_environment end.to raise_error(ArgumentError, ":invalid_environment is not a valid environment") end end - + describe "self.logger" do it "defaults to logging to stdout with log_level info" do begin old_logger = Braintree::Configuration.logger Braintree::Configuration.logger = nil @@ -97,11 +97,11 @@ expect do Braintree::Configuration.merchant_id end.to raise_error(Braintree::ConfigurationError, "Braintree::Configuration.merchant_id needs to be set") end end - + describe "self.public_key" do it "raises an exception if it hasn't been set yet" do Braintree::Configuration.instance_variable_set(:@public_key, nil) expect do Braintree::Configuration.public_key @@ -135,16 +135,16 @@ end end describe "self.protocol" do it "is http for development" do - Braintree::Configuration.environment = :development + Braintree::Configuration.environment = :development Braintree::Configuration.protocol.should == "http" end it "is https for production" do - Braintree::Configuration.environment = :production + Braintree::Configuration.environment = :production Braintree::Configuration.protocol.should == "https" end it "is https for sandbox" do Braintree::Configuration.environment = :sandbox @@ -167,11 +167,11 @@ it "is sandbox.braintreegateway.com for sandbox" do Braintree::Configuration.environment = :sandbox Braintree::Configuration.server.should == "sandbox.braintreegateway.com" end end - + describe "self.ssl?" do it "returns false for development" do Braintree::Configuration.environment = :development Braintree::Configuration.ssl?.should == false end @@ -184,7 +184,7 @@ it "returns true for sandbox" do Braintree::Configuration.environment = :sandbox Braintree::Configuration.ssl?.should == true end end - + end