Skip to content

Commit 5195f48

Browse files
committed
(maint) add VCR to the bundle and configure it for rspec
VCR allows more straight-forward stubbing in HTTP tests. The suggestion was made by Adrien Thebo, and the configuration was adapted from the one in r10k.
1 parent b924cad commit 5195f48

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Gemfile

+3
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ group(:development, :test) do
4949
gem "rubocop", "~> 0.26.1", :platforms => [:ruby]
5050

5151
gem 'rdoc', "~> 4.1", :platforms => [:ruby]
52+
53+
gem 'webmock'
54+
gem 'vcr', '~> 2.9'
5255
end
5356

5457
group(:development) do

spec/spec_helper.rb

+7
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ module PuppetSpec
4343
require behaviour.relative_path_from(Pathname.new(dir))
4444
end
4545

46+
require 'vcr'
47+
VCR.configure do |vcr|
48+
vcr.cassette_library_dir = File.expand_path('vcr/cassettes', PuppetSpec::FIXTURE_DIR)
49+
vcr.hook_into :webmock
50+
vcr.configure_rspec_metadata!
51+
end
52+
4653
RSpec.configure do |config|
4754
include PuppetSpec::Fixtures
4855

0 commit comments

Comments
 (0)