summaryrefslogtreecommitdiff
path: root/spec/unit/data_collector_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/data_collector_spec.rb')
-rw-r--r--spec/unit/data_collector_spec.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/spec/unit/data_collector_spec.rb b/spec/unit/data_collector_spec.rb
index a469808e63..87729d8652 100644
--- a/spec/unit/data_collector_spec.rb
+++ b/spec/unit/data_collector_spec.rb
@@ -2,7 +2,7 @@
# Author:: Adam Leff (<adamleff@chef.io)
# Author:: Ryan Cragun (<ryan@chef.io>)
#
-# Copyright:: Copyright 2012-2016, Chef Software Inc.
+# Copyright:: Copyright 2012-2018, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -804,14 +804,15 @@ describe Chef::DataCollector::Reporter do
context "when valid output_locations are provided" do
it "does not raise an exception" do
- Chef::Config[:data_collector][:output_locations] = { :urls => ["http://data_collector"], :files => ["data_collection.json"] }
+ expect(reporter).to receive(:open).with("data_collection.json", "a")
+ Chef::Config[:data_collector][:output_locations] = { urls: ["http://data_collector"], files: ["data_collection.json"] }
expect { reporter.send(:validate_data_collector_output_locations!) }.not_to raise_error(Chef::Exceptions::ConfigurationError)
end
end
context "when output_locations contains an invalid URI" do
it "raises an exception" do
- Chef::Config[:data_collector][:output_locations] = { :urls => ["this is not a url"], :files => ["/tmp/data_collection.json"] }
+ Chef::Config[:data_collector][:output_locations] = { urls: ["this is not a url"], files: ["/tmp/data_collection.json"] }
expect { reporter.send(:validate_data_collector_output_locations!) }.to raise_error(Chef::Exceptions::ConfigurationError)
end
end