Skip to content

Commit 1203586

Browse files
committed
(maint) Fix SqlConnection connection string tests
- These tests were previously stubbing return values instead of asserting that the code was behaving properly.
1 parent 305e872 commit 1203586

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spec/unit/puppet_x/sql_connection_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ def stub_connection
4141
@connection.stubs(:Execute)
4242
end
4343
it 'should not add MSSQLSERVER to connection string' do
44-
@connection.stubs(:Open).with('Provider=SQLOLEDB.1;User ID=sa;Password=Pupp3t1@;Initial Catalog=master;Application Name=Puppet;Data Source=localhost')
44+
@connection.expects(:Open).with('Provider=SQLOLEDB.1;User ID=sa;Password=Pupp3t1@;Initial Catalog=master;Application Name=Puppet;Data Source=localhost')
4545
subject.open_and_run_command('query', config)
4646
end
4747
it 'should add a non default instance to connection string' do
48-
@connection.stubs(:Open).with('Provider=SQLOLEDB.1;User ID=superuser;Password=puppetTested;Initial Catalog=master;Application Name=Puppet;Data Source=localhost\LOGGING')
48+
@connection.expects(:Open).with('Provider=SQLOLEDB.1;User ID=superuser;Password=puppetTested;Initial Catalog=master;Application Name=Puppet;Data Source=localhost\LOGGING')
4949
subject.open_and_run_command('query', {:admin_user => 'superuser', :admin_pass => 'puppetTested', :instance_name => 'LOGGING'})
5050
end
5151
end

0 commit comments

Comments
 (0)