Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Split up long method

  • Loading branch information...
commit e52a8742b3ca76f30d7e002da8e48cc647c21e1f 1 parent b345058
@jferris jferris authored
Showing with 18 additions and 8 deletions.
  1. +18 −8 lib/fake_braintree.rb
View
26 lib/fake_braintree.rb
@@ -24,15 +24,9 @@ class << self
end
def self.activate!
- Braintree::Configuration.environment = :development
- Braintree::Configuration.merchant_id = "xxx"
- Braintree::Configuration.public_key = "xxx"
- Braintree::Configuration.private_key = "xxx"
+ set_configuration
clear!
- Capybara.server_port = 3000
- server = Capybara::Server.new(FakeBraintree::SinatraApp)
- server.boot
- ENV['GATEWAY_PORT'] = server.port.to_s
+ boot_server
end
def self.log_file_path
@@ -100,6 +94,22 @@ def self.credit_card_from_token(token)
return card if card
end
end
+
+ private
+
+ def self.set_configuration
+ Braintree::Configuration.environment = :development
+ Braintree::Configuration.merchant_id = "xxx"
+ Braintree::Configuration.public_key = "xxx"
+ Braintree::Configuration.private_key = "xxx"
+ end
+
+ def self.boot_server
+ Capybara.server_port = 3000
+ server = Capybara::Server.new(FakeBraintree::SinatraApp)
+ server.boot
+ ENV['GATEWAY_PORT'] = server.port.to_s
+ end
end
FakeBraintree.activate!
Please sign in to comment.
Something went wrong with that request. Please try again.