Skip to content

Commit

Permalink
Extract vcr into loader and fix due to webmock/vcr upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
mnoack committed May 9, 2016
1 parent 8657652 commit f644df8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
12 changes: 2 additions & 10 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,14 @@
require 'rspec/its'
require 'date' # Needed for stamp
require 'stamp' # Some reasons stamp doesn't load automatically?
require 'vcr'

ENV['QT_KEYS'] ||= 'test_key_1,test_key_2'
qt_keys = ENV['QT_KEYS'].split(',')
VCR.configure do |c|
c.cassette_library_dir = 'spec/support/cassettes'
c.default_cassette_options = { match_requests_on: [:method, :uri, :body] }
c.filter_sensitive_data('<QT_KEY>') { qt_keys[0] }
c.filter_sensitive_data('<QT_KEY_2>') { qt_keys[1] }
c.hook_into :webmock
end

require 'support/vcr_loader'
require 'support/coverage_loader'
require 'quick_travel' # eager load to ensure coverage correct

require 'quick_travel/config'
qt_keys = ENV['QT_KEYS'].split(',')
QuickTravel.configure do |c|
c.url = 'http://test.qt.sealink.com.au:8080'
c.access_key = qt_keys[0]
Expand Down
12 changes: 12 additions & 0 deletions spec/support/vcr_loader.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
require 'vcr'
require 'webmock/rspec'

qt_keys = ENV['QT_KEYS'].split(',')

VCR.configure do |c|
c.cassette_library_dir = 'spec/support/cassettes'
c.default_cassette_options = { match_requests_on: [:method, :uri, :body] }
c.filter_sensitive_data('<QT_KEY>') { qt_keys[0] }
c.filter_sensitive_data('<QT_KEY_2>') { qt_keys[1] }
c.hook_into :webmock
end

0 comments on commit f644df8

Please sign in to comment.