You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In an example below, I expect filename is printed in its error message:
% inspec exec demo.rb
(snip)
Json /nonexistent.json
↺ Can't find file "" <---- here
% cat demo.rb
describe json('/nonexistent.json') do
its('name') { should eq 'hello' }
end
%
InSpec and Platform Version
InSpec version : 1.7.1
Platform Version: macOS Sierra 10.12.1
Replication Case
See demo.rb above - run a test with a non-existent json filename.
Possible Solutions
According to resources/json.rb, the error message refers to @conf_path, which is undefined.
@path = opts
@file = inspec.file(@opts)
@file_content = @file.content
# check if file is available
if !@file.file?
skip_resource "Can't find file \"#{@conf_path}\""
return @params = {}
end
I believe the pull request #1345 is almost correct to handle this (successful unit test included in the PR) but I couldn't figure out why one of the functional test failed in Travis CI. I ran the same test using Travis CI several times, which did not reproduce the same test failure.
Stacktrace
No stacktrace is produced.
Thank you for your help in advance.
The text was updated successfully, but these errors were encountered:
Hello!
Description
In an example below, I expect filename is printed in its error message:
InSpec and Platform Version
InSpec version : 1.7.1
Platform Version: macOS Sierra 10.12.1
Replication Case
See demo.rb above - run a test with a non-existent json filename.
Possible Solutions
According to resources/json.rb, the error message refers to @conf_path, which is undefined.
I believe the pull request #1345 is almost correct to handle this (successful unit test included in the PR) but I couldn't figure out why one of the functional test failed in Travis CI. I ran the same test using Travis CI several times, which did not reproduce the same test failure.
Stacktrace
No stacktrace is produced.
Thank you for your help in advance.
The text was updated successfully, but these errors were encountered: