spec/spec_helper.rb in fortnox-api-0.4.0 vs spec/spec_helper.rb in fortnox-api-0.5.0
- old
+ new
@@ -5,14 +5,12 @@
require 'pry'
require "codeclimate-test-reporter"
require 'support/matchers'
require 'support/helpers'
require 'support/vcr_setup'
-require 'dotenv'
CodeClimate::TestReporter.start
-Dotenv.load('.env.test')
RSpec.configure do |config|
config.run_all_when_everything_filtered = true
config.filter_run :focus
@@ -35,7 +33,14 @@
end
end
config.after do
Object.send(:remove_const, Test.remove_constants.name)
+ end
+
+ # Reset configuration after each test run
+ config.after do
+ Fortnox::API::DEFAULT_CONFIGURATION.each do |key, value|
+ Fortnox::API.config.send("#{ key }=", value)
+ end
end
end