Skip to content

Commit

Permalink
Move environment initialization to a before hook and rename method fo…
Browse files Browse the repository at this point in the history
…r clarity
  • Loading branch information
pmorton committed Apr 12, 2016
1 parent 353e039 commit 1d86292
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,20 @@ def stub_api_request method, uri, fixture = nil
stub_request(method, uri.to_s).to_return response
end

def environment
def reset_recurly_environment!
Recurly.subdomain = 'api'
Recurly.api_key = 'api_key'
Recurly.default_currency = 'USD'
Recurly.logger = Logger.new nil
end
end

include SpecHelper

environment

class Minitest::Spec
after do |tests|
include SpecHelper

before do |tests|
WebMock.reset!
environment
reset_recurly_environment!
end
end

Expand Down

0 comments on commit 1d86292

Please sign in to comment.