summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2017-03-30 12:55:34 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2017-03-30 12:55:34 -0700
commit56b912d1f928abdd7b1e58ba0db8400d1e4b19bf (patch)
tree9d486c41e25ffb26ce3e47d1935cbc9221dbb5fe
parentde209e6ee12939f641ec0ed002c2d3506abaafe7 (diff)
downloadchef-56b912d1f928abdd7b1e58ba0db8400d1e4b19bf.tar.gz
fix specs for nameless resources
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r--spec/unit/property_spec.rb2
-rw-r--r--spec/unit/resource/conditional_spec.rb4
2 files changed, 3 insertions, 3 deletions
diff --git a/spec/unit/property_spec.rb b/spec/unit/property_spec.rb
index bd90891b63..79ec05ea6d 100644
--- a/spec/unit/property_spec.rb
+++ b/spec/unit/property_spec.rb
@@ -301,7 +301,7 @@ describe "Chef::Resource.property" do
expect(resource.property_is_set?(:name)).to be_truthy
resource.reset_property(:name)
expect(resource.property_is_set?(:name)).to be_falsey
- expect(resource.name).to be_nil
+ expect { resource.name }.to raise_error Chef::Exceptions::ValidationFailed
end
it "when referencing an undefined property, reset_property(:x) raises an error" do
diff --git a/spec/unit/resource/conditional_spec.rb b/spec/unit/resource/conditional_spec.rb
index e84b0980c4..135f798676 100644
--- a/spec/unit/resource/conditional_spec.rb
+++ b/spec/unit/resource/conditional_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Daniel DeLeo (<dan@chef.io>)
-# Copyright:: Copyright 2011-2016, Chef Software Inc.
+# Copyright:: Copyright 2011-2017, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -24,7 +24,7 @@ describe Chef::Resource::Conditional do
allow_any_instance_of(Mixlib::ShellOut).to receive(:run_command).and_return(nil)
@status = OpenStruct.new(:success? => true)
allow_any_instance_of(Mixlib::ShellOut).to receive(:status).and_return(@status)
- @parent_resource = Chef::Resource.new(nil, Chef::Node.new)
+ @parent_resource = Chef::Resource.new("", Chef::Node.new)
end
it "raises an exception when neither a block or command is given" do