@@ -17,7 +17,7 @@ def stub_connection
17
17
context 'command execution' do
18
18
before :each do
19
19
stub_connection
20
- @connection . stubs ( :Open ) . with ( 'Provider=SQLOLEDB.1;Initial Catalog=master;Application Name=Puppet;Data Source=localhost ;User ID=sa;Password=Pupp3t1@' )
20
+ @connection . stubs ( :Open ) . with ( 'Provider=SQLOLEDB.1;Initial Catalog=master;Application Name=Puppet;Data Source=. ;User ID=sa;Password=Pupp3t1@' )
21
21
end
22
22
it 'should not raise an error but populate has_errors with message' do
23
23
subject . stubs ( :execute ) . raises ( Exception . new ( "SQL Server\n error has happened" ) )
@@ -43,7 +43,7 @@ def stub_connection
43
43
44
44
context 'Use default authentication' do
45
45
it 'should defaul to SQL_LOGIN if admin_login_type is not set' do
46
- @connection . expects ( :Open ) . with ( 'Provider=SQLOLEDB.1;Initial Catalog=master;Application Name=Puppet;Data Source=localhost ;User ID=sa;Password=Pupp3t1@' )
46
+ @connection . expects ( :Open ) . with ( 'Provider=SQLOLEDB.1;Initial Catalog=master;Application Name=Puppet;Data Source=. ;User ID=sa;Password=Pupp3t1@' )
47
47
subject . open_and_run_command ( 'query' , { :admin_user => 'sa' , :admin_pass => 'Pupp3t1@' } )
48
48
end
49
49
end
@@ -66,11 +66,11 @@ def stub_connection
66
66
end
67
67
68
68
it 'should not add the default instance of MSSQLSERVER to connection string' do
69
- @connection . expects ( :Open ) . with ( 'Provider=SQLOLEDB.1;Initial Catalog=master;Application Name=Puppet;Data Source=localhost ;User ID=sa;Password=Pupp3t1@' )
69
+ @connection . expects ( :Open ) . with ( 'Provider=SQLOLEDB.1;Initial Catalog=master;Application Name=Puppet;Data Source=. ;User ID=sa;Password=Pupp3t1@' )
70
70
subject . open_and_run_command ( 'query' , { :admin_user => 'sa' , :admin_pass => 'Pupp3t1@' , :instance_name => 'MSSQLSERVER' } )
71
71
end
72
72
it 'should add a non default instance to connection string' do
73
- @connection . expects ( :Open ) . with ( 'Provider=SQLOLEDB.1;Initial Catalog=master;Application Name=Puppet;Data Source=localhost \\LOGGING;User ID=sa;Password=Pupp3t1@' )
73
+ @connection . expects ( :Open ) . with ( 'Provider=SQLOLEDB.1;Initial Catalog=master;Application Name=Puppet;Data Source=. \\LOGGING;User ID=sa;Password=Pupp3t1@' )
74
74
subject . open_and_run_command ( 'query' , { :admin_user => 'sa' , :admin_pass => 'Pupp3t1@' , :instance_name => 'LOGGING' } )
75
75
end
76
76
end
@@ -93,12 +93,12 @@ def stub_connection
93
93
end
94
94
95
95
it 'should add integrated security to the connection string if admin and password are empty' do
96
- @connection . expects ( :Open ) . with ( 'Provider=SQLOLEDB.1;Initial Catalog=master;Application Name=Puppet;Data Source=localhost ;Integrated Security=SSPI' )
96
+ @connection . expects ( :Open ) . with ( 'Provider=SQLOLEDB.1;Initial Catalog=master;Application Name=Puppet;Data Source=. ;Integrated Security=SSPI' )
97
97
subject . open_and_run_command ( 'query' , { :admin_user => '' , :admin_pass => '' , :admin_login_type => 'WINDOWS_LOGIN' } )
98
98
end
99
99
100
100
it 'should add integrated security to the connection string if admin and password are not defined' do
101
- @connection . expects ( :Open ) . with ( 'Provider=SQLOLEDB.1;Initial Catalog=master;Application Name=Puppet;Data Source=localhost ;Integrated Security=SSPI' )
101
+ @connection . expects ( :Open ) . with ( 'Provider=SQLOLEDB.1;Initial Catalog=master;Application Name=Puppet;Data Source=. ;Integrated Security=SSPI' )
102
102
subject . open_and_run_command ( 'query' , { :admin_login_type => 'WINDOWS_LOGIN' } )
103
103
end
104
104
end
0 commit comments