diff --git a/test/unit/resources/file_test.rb b/test/unit/resources/file_test.rb index 2a8a439b4..fef1a6cb8 100644 --- a/test/unit/resources/file_test.rb +++ b/test/unit/resources/file_test.rb @@ -21,7 +21,7 @@ describe Inspec::Resources::FileResource do resource.stubs(:file_permission_granted?).with('write', 'by_usergroup', 'by_specific_user').returns('test_result') resource.stubs(:file_permission_granted?).with('execute', 'by_usergroup', 'by_specific_user').returns('test_result') _(resource.content).must_equal 'content' - _(resource.more_permissive_than?('000').must_equal false) + _(resource.more_permissive_than?('000')).must_equal false _(resource.exist?).must_equal true _(resource.mounted?).must_equal true _(resource.to_s).must_equal 'File /fakepath/fakefile' @@ -84,11 +84,11 @@ end describe Inspec::Resources::FileResource do let(:file) { stub(unix_mode_mask: 000, mode: 644) } - it 'responds on Ubuntu' do + it 'more_permissive_than?' do resource = MockLoader.new(:ubuntu1404).load_resource('file', '/fakepath/fakefile') - _(resource.more_permissive_than?('755').must_equal false) - _(resource.more_permissive_than?('644').must_equal false) - _(resource.more_permissive_than?('640').must_equal true) + _(resource.more_permissive_than?('755')).must_equal false + _(resource.more_permissive_than?('644')).must_equal false + _(resource.more_permissive_than?('640')).must_equal true proc { resource.send(:more_permissive_than?, '0888') }.must_raise(ArgumentError) end end diff --git a/test/unit/resources/postgres_session_test.rb b/test/unit/resources/postgres_session_test.rb index dbf9c3c89..bd4b1ace7 100644 --- a/test/unit/resources/postgres_session_test.rb +++ b/test/unit/resources/postgres_session_test.rb @@ -5,10 +5,10 @@ require 'helper' describe 'Inspec::Resources::PostgresSession' do it 'verify postgres_session create_psql_cmd with a basic query' do resource = load_resource('postgres_session','myuser','mypass','127.0.0.1') - _(resource.send(:create_psql_cmd,"SELECT * FROM STUDENTS;",['testdb']).must_equal "PGPASSWORD='mypass' psql -U myuser -d testdb -h 127.0.0.1 -A -t -c SELECT\\ \\*\\ FROM\\ STUDENTS\\;") + _(resource.send(:create_psql_cmd, "SELECT * FROM STUDENTS;",['testdb'])).must_equal "PGPASSWORD='mypass' psql -U myuser -d testdb -h 127.0.0.1 -A -t -c SELECT\\ \\*\\ FROM\\ STUDENTS\\;" end it 'verify postgres_session escaped_query with a complex query' do resource = load_resource('postgres_session','myuser','mypass','127.0.0.1') - _(resource.send(:create_psql_cmd,"SELECT current_setting('client_min_messages')",['testdb']).must_equal "PGPASSWORD='mypass' psql -U myuser -d testdb -h 127.0.0.1 -A -t -c SELECT\\ current_setting\\(\\'client_min_messages\\'\\)") + _(resource.send(:create_psql_cmd, "SELECT current_setting('client_min_messages')",['testdb'])).must_equal "PGPASSWORD='mypass' psql -U myuser -d testdb -h 127.0.0.1 -A -t -c SELECT\\ current_setting\\(\\'client_min_messages\\'\\)" end end