Skip to content

Commit

Permalink
change json-min filename
Browse files Browse the repository at this point in the history
Signed-off-by: Jeremy J. Miller <jm@chef.io>
  • Loading branch information
jeremymv2 committed Dec 3, 2016
1 parent 243d886 commit 79421bd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion files/default/handler/audit_report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def send_report(reporter, server, user, profiles, report)
Chef::Log.warn "unable to determine chef-server url required by inspec report collector '#{reporter}'. Skipping..."
end
elsif reporter == 'json-file'
timestamp = Time.now.utc.to_s.tr(' ', '_')
timestamp = Time.now.utc.strftime('%Y%m%d%H%M%S')
Collector::JsonFile.new(report, timestamp).send_report
else
Chef::Log.warn "#{reporter} is not a supported InSpec report collector"
Expand Down
4 changes: 2 additions & 2 deletions spec/unit/libraries/json_file_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
describe 'Collector::JsonFile methods' do
it 'writes the report to a file on disk' do
report = 'some info'
timestamp = Time.now.utc.to_s.tr(' ', '_')
timestamp = Time.now.utc.strftime('%Y%m%d%H%M%S')
@jsonfile = Collector::JsonFile.new(report, timestamp).send_report
expected_file_path = File.expand_path("../../../../inspec-#{timestamp}.json", __FILE__)
expect(File).to exist("#{expected_file_path}")
File.delete("#{expected_file_path}")
end
end
end

0 comments on commit 79421bd

Please sign in to comment.