lib/parliament/utils/test_helpers/vcr_helper.rb in parliament-utils-0.4.0 vs lib/parliament/utils/test_helpers/vcr_helper.rb in parliament-utils-0.4.1
- old
+ new
@@ -1,12 +1,22 @@
module Parliament
module Utils
module TestHelpers
module VCRHelper
- require 'vcr'
+ begin
+ require 'vcr'
+ LOADED_VCR = true
+ rescue LoadError
+ puts 'VCR Helper could not find VCR. This may be expected in production environments.'
+
+ LOADED_VCR = false
+ end
+
def self.load_rspec_config(config)
+ return unless LOADED_VCR
+
# URIs that appear frequently
parliament_uri = 'http://localhost:3030'
bandiera_uri = 'http://localhost:5000'
opensearch_uri = 'https://apidataparliament.azure-api.net/search/description'
@@ -80,9 +90,11 @@
config.filter_sensitive_data(new_line) { line }
end
end
end
end
+
+ config
end
end
end
end
end