@@ -17,7 +17,7 @@ def stub_connection
1717 context 'command execution' do
1818 before :each do
1919 stub_connection
20- @connection . stubs ( :Open ) . with ( 'Provider=SQLOLEDB.1 ;Initial Catalog=master;Application Name=Puppet;Data Source=.;User ID=sa;Password=Pupp3t1@' )
20+ @connection . stubs ( :Open ) . with ( 'Provider=SQLNCLI11 ;Initial Catalog=master;Application Name=Puppet;Data Source=.;DataTypeComptibility=80 ;User ID=sa;Password=Pupp3t1@' )
2121 end
2222 it 'should not raise an error but populate has_errors with message' do
2323 subject . stubs ( :execute ) . raises ( Exception . new ( "SQL Server\n error has happened" ) )
@@ -43,7 +43,7 @@ def stub_connection
4343
4444 context 'Use default authentication' do
4545 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=.;User ID=sa;Password=Pupp3t1@' )
46+ @connection . expects ( :Open ) . with ( 'Provider=SQLNCLI11 ;Initial Catalog=master;Application Name=Puppet;Data Source=.;DataTypeComptibility=80 ;User ID=sa;Password=Pupp3t1@' )
4747 subject . open_and_run_command ( 'query' , { :admin_user => 'sa' , :admin_pass => 'Pupp3t1@' } )
4848 end
4949 end
@@ -66,11 +66,11 @@ def stub_connection
6666 end
6767
6868 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=.;User ID=sa;Password=Pupp3t1@' )
69+ @connection . expects ( :Open ) . with ( 'Provider=SQLNCLI11 ;Initial Catalog=master;Application Name=Puppet;Data Source=.;DataTypeComptibility=80 ;User ID=sa;Password=Pupp3t1@' )
7070 subject . open_and_run_command ( 'query' , { :admin_user => 'sa' , :admin_pass => 'Pupp3t1@' , :instance_name => 'MSSQLSERVER' } )
7171 end
7272 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=.\\LOGGING;User ID=sa;Password=Pupp3t1@' )
73+ @connection . expects ( :Open ) . with ( 'Provider=SQLNCLI11 ;Initial Catalog=master;Application Name=Puppet;Data Source=.\\LOGGING;DataTypeComptibility=80 ;User ID=sa;Password=Pupp3t1@' )
7474 subject . open_and_run_command ( 'query' , { :admin_user => 'sa' , :admin_pass => 'Pupp3t1@' , :instance_name => 'LOGGING' } )
7575 end
7676 end
@@ -93,12 +93,12 @@ def stub_connection
9393 end
9494
9595 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=.;Integrated Security=SSPI' )
96+ @connection . expects ( :Open ) . with ( 'Provider=SQLNCLI11 ;Initial Catalog=master;Application Name=Puppet;Data Source=.;DataTypeComptibility=80 ;Integrated Security=SSPI' )
9797 subject . open_and_run_command ( 'query' , { :admin_user => '' , :admin_pass => '' , :admin_login_type => 'WINDOWS_LOGIN' } )
9898 end
9999
100100 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=.;Integrated Security=SSPI' )
101+ @connection . expects ( :Open ) . with ( 'Provider=SQLNCLI11 ;Initial Catalog=master;Application Name=Puppet;Data Source=.;DataTypeComptibility=80 ;Integrated Security=SSPI' )
102102 subject . open_and_run_command ( 'query' , { :admin_login_type => 'WINDOWS_LOGIN' } )
103103 end
104104 end
0 commit comments