summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeha Pansare <neha.pansare@progress.com>2022-02-09 18:25:48 +0530
committerJohn McCrae <john.mccrae@progress.com>2022-02-17 14:52:45 -0800
commit3c70be5f8c0b1a5961fdfaf9d7a5e3f03affec1f (patch)
tree27215cd6dd57ba0adb3a35cc39be4ac17dbafba0
parent68bf0bd080b04c5446eadb1ac469f4d298655ead (diff)
downloadchef-3c70be5f8c0b1a5961fdfaf9d7a5e3f03affec1f.tar.gz
Update resource build calls to use resource_context for Subscribes specs
Signed-off-by: Neha Pansare <neha.pansare@progress.com>
-rw-r--r--spec/unit/resource_spec.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/spec/unit/resource_spec.rb b/spec/unit/resource_spec.rb
index 95aed42f5b..f0a624d5db 100644
--- a/spec/unit/resource_spec.rb
+++ b/spec/unit/resource_spec.rb
@@ -309,26 +309,26 @@ describe Chef::Resource do
end
it "should make resources appear in the actions hash of subscribed nodes" do
- run_context.resource_collection << Chef::Resource::ZenMaster.new("coffee")
+ run_context.resource_collection << Chef::Resource::ZenMaster.new("coffee", run_context)
zr = run_context.resource_collection.find(zen_master: "coffee")
resource.subscribes :reload, zr
- expect(zr.delayed_notifications.detect { |e| e.resource.name == resource.name && e.action == :reload }).not_to be_nil
+ expect(zr.delayed_notifications.detect { |e| e.resource.name == "funk" && e.action == :reload }).not_to be_nil
end
it "should make resources appear in the actions hash of subscribed nodes" do
- run_context.resource_collection << Chef::Resource::ZenMaster.new("coffee")
+ run_context.resource_collection << Chef::Resource::ZenMaster.new("coffee", run_context)
zr = run_context.resource_collection.find(zen_master: "coffee")
resource.subscribes :reload, zr
expect(zr.delayed_notifications.detect { |e| e.resource.name == resource.name && e.action == :reload }).not_to be_nil
- run_context.resource_collection << Chef::Resource::ZenMaster.new("bean")
+ run_context.resource_collection << Chef::Resource::ZenMaster.new("bean", run_context)
zrb = run_context.resource_collection.find(zen_master: "bean")
- resource.subscribes :reload, zrb
- expect(zrb.delayed_notifications.detect { |e| e.resource.name == resource.name && e.action == :reload }).not_to be_nil
+ zrb.subscribes :reload, zr
+ expect(zr.delayed_notifications.detect { |e| e.resource.name == resource.name && e.action == :reload }).not_to be_nil
end
it "should make subscribed resources be capable of acting immediately" do
- run_context.resource_collection << Chef::Resource::ZenMaster.new("coffee")
+ run_context.resource_collection << Chef::Resource::ZenMaster.new("coffee", run_context)
zr = run_context.resource_collection.find(zen_master: "coffee")
resource.subscribes :reload, zr, :immediately
expect(zr.immediate_notifications.detect { |e| e.resource.name == resource.name && e.action == :reload }).not_to be_nil