Skip to content

Commit 0455335

Browse files
committed
Fix rspec tests with rspec-puppet
Prior to this commit, tests in master were broken due to changes in rspec puppet. The last working version for the previous code to successfully test on was rspec-puppet 2.6.11. This commit updates the spec tests to work with 2.6.12 and 2.6.13
1 parent c859bae commit 0455335

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

spec/unit/classes/master/report_processor_spec.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
require 'spec_helper'
22

33
describe 'puppetdb::master::report_processor', :type => :class do
4+
around(:each) do |example|
5+
confdir = RSpec.configuration.confdir
6+
RSpec.configuration.confdir = '/etc/puppet'
7+
example.run
8+
RSpec.configuration.confdir = confdir
9+
end
10+
411
on_supported_os.each do |os, facts|
512
context "on #{os}" do
613
let(:facts) do

spec/unit/classes/server/command_processing_spec.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
}
1010
end
1111

12+
let(:pre_condition) { 'include puppetdb::server::global' }
13+
1214
it { should contain_class('puppetdb::server::command_processing') }
1315

1416
describe 'when using default values' do
@@ -43,7 +45,13 @@
4345
end
4446

4547
describe 'when using legacy PuppetDB' do
46-
let (:pre_condition) { 'class { "puppetdb::globals": version => "2.2.0", }' }
48+
let (:pre_condition) do
49+
[
50+
'class { "puppetdb::globals": version => "2.2.0", }',
51+
super(),
52+
].join("\n")
53+
end
54+
4755
it { should contain_ini_setting('puppetdb_command_processing_threads').
4856
with(
4957
'ensure' => 'absent',

0 commit comments

Comments
 (0)