summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/data/lwrp_const_scoping/resources/conflict.rb0
-rw-r--r--spec/unit/lwrp_spec.rb8
2 files changed, 8 insertions, 0 deletions
diff --git a/spec/data/lwrp_const_scoping/resources/conflict.rb b/spec/data/lwrp_const_scoping/resources/conflict.rb
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/spec/data/lwrp_const_scoping/resources/conflict.rb
diff --git a/spec/unit/lwrp_spec.rb b/spec/unit/lwrp_spec.rb
index 3e807bc06c..19d3504f3c 100644
--- a/spec/unit/lwrp_spec.rb
+++ b/spec/unit/lwrp_spec.rb
@@ -18,6 +18,8 @@
require 'spec_helper'
+module LwrpConstScopingConflict
+end
describe "LWRP" do
before do
@@ -72,6 +74,12 @@ describe "LWRP" do
Chef::Resource.resource_classes.should_not include(first_lwr_foo_class)
end
+ it "does not attempt to remove classes from higher up namespaces [CHEF-4117]" do
+ conflicting_lwrp_file = File.expand_path( "lwrp_const_scoping/resources/conflict.rb", CHEF_SPEC_DATA)
+ # The test is that this should not raise an error:
+ Chef::Resource::LWRPBase.build_from_file("lwrp_const_scoping", conflicting_lwrp_file, nil)
+ end
+
end
describe "Lightweight Chef::Resource" do