Skip to content

Commit 963a616

Browse files
authored
Merge pull request #273 from Iristyle/maint-spec-fixes
(maint) Spec fixes
2 parents 0303bf0 + 6a5c39f commit 963a616

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

spec/spec_helper.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
c.before :each do
3232
# set to strictest setting for testing
3333
# by default Puppet runs at warning level
34-
Puppet.settings[:strict] = :warning
34+
# newer versions of Puppet remove :strict
35+
Puppet.settings[:strict] = :warning if Puppet.settings.include?(:strict)
3536
end
3637
end
3738

spec/unit/puppet_x/sql_connection_spec.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,13 @@ def stub_connection
2424
@connection.stubs(:Open).with('Provider=SQLNCLI11;Initial Catalog=master;Application Name=Puppet;Data Source=.;DataTypeComptibility=80;User ID=sa;Password=Pupp3t1@')
2525
end
2626
it 'should not raise an error but populate has_errors with message' do
27-
@connection.Errors.stubs(:count).returns(1)
28-
@connection.Errors.stubs(:Description).returns("SQL Error in Connection")
27+
@connection.Errors.stubs(:count).returns(2)
28+
@connection.expects(:Errors).with(0).returns(stub( { :Description => "SQL Error in Connection" }))
29+
@connection.expects(:Errors).with(1).returns(stub( { :Description => "Rowdy Roddy Piper" }))
2930
expect {
3031
result = subject.open_and_run_command('whacka whacka whacka', config)
3132
expect(result.exitstatus).to eq(1)
32-
expect(result.error_message).to eq('SQL Error in Connection')
33+
expect(result.error_message).to eq("SQL Error in Connection\nRowdy Roddy Piper")
3334
}.to_not raise_error(Exception)
3435

3536
end

0 commit comments

Comments
 (0)