mirror of
https://github.com/inspec/inspec
synced 2024-11-23 21:23:29 +00:00
0839be50d6
* improve database parsing * support sqlcli * ensure headers are downcast * externalize database helper * use password as argument * feedback from @adamleff * inline docs update + linting * stay backwards compatible * implement tests
21 lines
770 B
Ruby
21 lines
770 B
Ruby
# encoding: utf-8
|
|
# author: Nolan Davidson
|
|
# author: Christoph Hartmann
|
|
|
|
require 'helper'
|
|
|
|
describe 'Inspec::Resources::MssqlSession' do
|
|
it 'verify mssql_session configuration' do
|
|
resource = load_resource('mssql_session', user: 'sa', password: 'yourStrong(!)Password', host: 'localhost')
|
|
_(resource.user).must_equal 'sa'
|
|
_(resource.password).must_equal 'yourStrong(!)Password'
|
|
_(resource.host).must_equal 'localhost'
|
|
end
|
|
|
|
it 'run a SQL query' do
|
|
resource = load_resource('mssql_session', user: 'sa', password: 'yourStrong(!)Password', host: 'localhost')
|
|
query = resource.query("SELECT SERVERPROPERTY('ProductVersion') as result")
|
|
_(query.size).must_equal 1
|
|
_(query.row(0).column('result').value).must_equal '14.0.600.250'
|
|
end
|
|
end
|