spec/helper.rb in octospy-0.0.8 vs spec/helper.rb in octospy-0.1.0
- old
+ new
@@ -2,15 +2,13 @@
require 'simplecov'
require 'coveralls'
require 'octospy'
require 'rspec'
-require 'json'
-require 'hashie'
-require 'awesome_print'
-require 'webmock/rspec'
+require 'ap'
require 'vcr'
+require 'webmock/rspec'
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
SimpleCov::Formatter::HTMLFormatter,
Coveralls::SimpleCov::Formatter
]
@@ -18,12 +16,19 @@
WebMock.disable_net_connect!(allow: 'coveralls.io')
RSpec.configure { |c| c.include WebMock::API }
VCR.configure do |c|
+ c.configure_rspec_metadata!
c.cassette_library_dir = 'spec/cassettes'
c.hook_into :webmock
+ c.default_cassette_options = {
+ serialize_with: :json,
+ preserve_exact_body_bytes: true,
+ decode_compressed_response: true,
+ record: :once
+ }
end
class String
def strip_heredoc
indent = scan(/^[ \t]*(?=\S)/).min.size || 0
@@ -69,11 +74,5 @@
stub_request(Regexp.last_match[1].to_sym, *args, &block)
else
super
end
end
-
-def support_path
- File.expand_path('../support', __FILE__)
-end
-
-Dir["#{support_path}/**/*.rb"].each { |f| require f }