diff options
author | Neha Pansare <neha.pansare@progress.com> | 2022-02-09 18:25:48 +0530 |
---|---|---|
committer | Neha Pansare <neha.pansare@progress.com> | 2022-02-09 18:42:07 +0530 |
commit | 9c3f1d4871566dc86aff7e3494a41a9fd6814608 (patch) | |
tree | 18c9d7d39b9138a4828c337379395ba1c53142d1 /spec/unit | |
parent | e8ee2c6f76efb7c954ef4adeac9a7d2a00ec8ad0 (diff) | |
download | chef-9c3f1d4871566dc86aff7e3494a41a9fd6814608.tar.gz |
Update resource build calls to use resource_context for Subscribes specs
Signed-off-by: Neha Pansare <neha.pansare@progress.com>
Diffstat (limited to 'spec/unit')
-rw-r--r-- | spec/unit/resource_spec.rb | 14 |
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 |