Mock missing_file in NGINX resource tests

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
This commit is contained in:
Jerry Aldrich 2019-01-12 15:44:36 -08:00
parent 62cfcf0ebe
commit 3b8da7957d
2 changed files with 2 additions and 1 deletions

View file

@ -198,6 +198,7 @@ class MockLoader
'/fakepath/fakefile' => emptyfile.call,
'C:/fakepath/fakefile' => emptyfile.call,
'/etc/cron.d/crondotd' => mockfile.call('crondotd'),
'/missing_file' => emptyfile.call,
}
# create all mock commands

View file

@ -13,7 +13,7 @@ describe 'Inspec::Resources::NginxConf' do
let(:nginx_conf) { MockLoader.new(:ubuntu1404).load_resource('nginx_conf') }
it 'doesnt fail with a missing file' do
nginx_conf = MockLoader.new(:ubuntu1404).load_resource('nginx_conf', '/....missing_file')
nginx_conf = MockLoader.new(:ubuntu1404).load_resource('nginx_conf', '/missing_file')
_(nginx_conf.params).must_equal({})
end