summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Cowie <jonlives@gmail.com>2018-02-20 11:04:03 +0000
committerJon Cowie <jonlives@gmail.com>2018-02-20 11:04:03 +0000
commit00fdd83323050fd6dc30dda0772fca753010adae (patch)
treea896736d8a9f4ed3f4da9d0ce203d99a8bffb025
parent5cf64952220d84bbf1a5e0711caa06841b6b4293 (diff)
downloadchef-00fdd83323050fd6dc30dda0772fca753010adae.tar.gz
Fix valid file path spec to work on Windows
Signed-off-by: Jon Cowie <jonlives@gmail.com>
-rw-r--r--spec/unit/data_collector_spec.rb11
1 files changed, 2 insertions, 9 deletions
diff --git a/spec/unit/data_collector_spec.rb b/spec/unit/data_collector_spec.rb
index 1189e89411..a469808e63 100644
--- a/spec/unit/data_collector_spec.rb
+++ b/spec/unit/data_collector_spec.rb
@@ -761,7 +761,7 @@ describe Chef::DataCollector::Reporter do
end
context "when server_url is omitted but output_locations is specified" do
- it "raises an exception" do
+ it "does not an exception" do
Chef::Config[:data_collector][:output_locations] = ["http://data_collector", "/tmp/data_collector.json"]
expect { reporter.send(:validate_data_collector_server_url!) }.not_to raise_error(Chef::Exceptions::ConfigurationError)
end
@@ -804,18 +804,11 @@ 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 => ["/tmp/data_collection.json"] }
+ 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 file path" do
- it "raises an exception" do
- Chef::Config[:data_collector][:output_locations] = { :urls => ["http://data_collector"], :files => ["/data_collector.json"] }
- expect { reporter.send(:validate_data_collector_output_locations!) }.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"] }