summaryrefslogtreecommitdiff
path: root/spec/unit/resource_collection_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/resource_collection_spec.rb')
-rw-r--r--spec/unit/resource_collection_spec.rb15
1 files changed, 8 insertions, 7 deletions
diff --git a/spec/unit/resource_collection_spec.rb b/spec/unit/resource_collection_spec.rb
index 3fec2d9477..c696572b13 100644
--- a/spec/unit/resource_collection_spec.rb
+++ b/spec/unit/resource_collection_spec.rb
@@ -1,7 +1,7 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
# Author:: Christopher Walters (<cw@chef.io>)
-# Copyright:: Copyright 2008-2016, Chef Software Inc.
+# Copyright:: Copyright 2008-2017, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -98,11 +98,11 @@ describe Chef::ResourceCollection do
it "should allow you to iterate over every resource in the collection" do
load_up_resources
results = Array.new
- expect {
+ expect do
rc.each do |r|
results << r.name
end
- }.not_to raise_error
+ end.not_to raise_error
results.each_index do |i|
case i
when 0
@@ -120,11 +120,11 @@ describe Chef::ResourceCollection do
it "should allow you to iterate over every resource by index" do
load_up_resources
results = Array.new
- expect {
+ expect do
rc.each_index do |i|
results << rc[i].name
end
- }.not_to raise_error
+ end.not_to raise_error
results.each_index do |i|
case i
when 0
@@ -219,6 +219,7 @@ describe Chef::ResourceCollection do
end
it "should find resources by strings of zen_master[a,b]" do
+ Chef::Config[:treat_deprecation_warnings_as_errors] = false
load_up_resources
results = rc.resources("zen_master[monkey,dog]")
expect(results.length).to eql(2)
@@ -291,10 +292,10 @@ describe Chef::ResourceCollection do
expect(rc.respond_to?(:from_json)).to eq(false)
end
- it "should convert from json using the CHEF::JSONCompat library" do
+ it "should convert from json using the Chef::JSONCompat library" do
rc << resource
json = Chef::JSONCompat.to_json(rc)
- s_rc = Chef::JSONCompat.from_json(json)
+ s_rc = Chef::ResourceCollection.from_json(json)
expect(s_rc).to be_a_kind_of(Chef::ResourceCollection)
expect(s_rc[0].name).to eql(resource.name)
end