diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2020-01-21 20:43:09 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2020-01-21 20:43:09 -0800 |
commit | 204783996d0dbe274675c935fce5f84f15c8c40a (patch) | |
tree | c4c032d4a5ecb8f59d04b2885f054d914c875012 /spec/unit/property_spec.rb | |
parent | 67a19dfb20c787a84a905859f3e6e76faa106bab (diff) | |
download | chef-lcg/ruby-2.7.0.tar.gz |
Fix most Ruby 2.7 test failureslcg/ruby-2.7.0
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'spec/unit/property_spec.rb')
-rw-r--r-- | spec/unit/property_spec.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/spec/unit/property_spec.rb b/spec/unit/property_spec.rb index 1fcbb77e8e..965da7313e 100644 --- a/spec/unit/property_spec.rb +++ b/spec/unit/property_spec.rb @@ -542,7 +542,7 @@ describe "Chef::Resource.property" do expect(resource.x).to eq "" end it "x is immutable" do - expect { resource.x << "foo" }.to raise_error(RuntimeError, "can't modify frozen String") + expect { resource.x << "foo" }.to raise_error(FrozenError, /can't modify frozen String/) end end @@ -562,7 +562,7 @@ describe "Chef::Resource.property" do expect(resource.x).to eq({}) end it "x is immutable" do - expect { resource.x["foo"] = "bar" }.to raise_error(RuntimeError, "can't modify frozen Hash") + expect { resource.x["foo"] = "bar" }.to raise_error(FrozenError, /can't modify frozen Hash/) end it "The same exact value is returned multiple times in a row" do value = resource.x @@ -595,13 +595,13 @@ describe "Chef::Resource.property" do expect(resource.x).to eq([{ foo: "bar" }]) end it "x is immutable" do - expect { resource.x << :other }.to raise_error(RuntimeError, "can't modify frozen Array") + expect { resource.x << :other }.to raise_error(FrozenError, /can't modify frozen Array/) end it "x.first is immutable" do - expect { resource.x.first[:foo] = "other" }.to raise_error(RuntimeError, "can't modify frozen Hash") + expect { resource.x.first[:foo] = "other" }.to raise_error(FrozenError, /can't modify frozen Hash/) end it "x.first[:foo] is immutable" do - expect { resource.x.first[:foo] << "other" }.to raise_error(RuntimeError, "can't modify frozen String") + expect { resource.x.first[:foo] << "other" }.to raise_error(FrozenError, /can't modify frozen String/) end end end @@ -1072,13 +1072,13 @@ describe "Chef::Resource.property" do it "raises an error if both name_property and name_attribute are specified" do expect { resource_class.property :x, name_property: false, name_attribute: 1 }.to raise_error ArgumentError, - /name_attribute and name_property are functionally identical and both cannot be specified on a property at once. Use just one on property x of resource chef_resource_property_spec_(\d+)./ + /name_attribute and name_property are functionally identical and both cannot be specified on a property at once. Use just one on property x of resource chef_resource_property_spec_(\d+)/ expect { resource_class.property :x, name_property: false, name_attribute: nil }.to raise_error ArgumentError, - /name_attribute and name_property are functionally identical and both cannot be specified on a property at once. Use just one on property x of resource chef_resource_property_spec_(\d+)./ + /name_attribute and name_property are functionally identical and both cannot be specified on a property at once. Use just one on property x of resource chef_resource_property_spec_(\d+)/ expect { resource_class.property :x, name_property: false, name_attribute: false }.to raise_error ArgumentError, - /name_attribute and name_property are functionally identical and both cannot be specified on a property at once. Use just one on property x of resource chef_resource_property_spec_(\d+)./ + /name_attribute and name_property are functionally identical and both cannot be specified on a property at once. Use just one on property x of resource chef_resource_property_spec_(\d+)/ expect { resource_class.property :x, name_property: true, name_attribute: true }.to raise_error ArgumentError, - /name_attribute and name_property are functionally identical and both cannot be specified on a property at once. Use just one on property x of resource chef_resource_property_spec_(\d+)./ + /name_attribute and name_property are functionally identical and both cannot be specified on a property at once. Use just one on property x of resource chef_resource_property_spec_(\d+)/ end context "property_type" do |