summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorAdam Edwards <adamed@opscode.com>2014-03-28 14:08:27 -0700
committerAdam Edwards <adamed@opscode.com>2014-03-29 00:21:12 -0700
commitdfe1ebf9bf59d02aa78c1fdef8787af1665a22fd (patch)
tree3df2b552435c442bf5f1e9b4d4562e969dc31998 /spec
parente0b02d69aaf9f408cfd9dbe9ea47561f694815bf (diff)
downloadchef-dfe1ebf9bf59d02aa78c1fdef8787af1665a22fd.tar.gz
Fix namespacing issues caused by moving guard_interpreter logic out of Chef::Resource
Diffstat (limited to 'spec')
-rw-r--r--spec/support/shared/unit/script_resource.rb4
-rw-r--r--spec/unit/guard_interpreter/resource_guard_interpreter_spec.rb (renamed from spec/unit/resource/conditional/guard_interpreter_spec.rb)6
-rw-r--r--spec/unit/resource/powershell_spec.rb6
-rw-r--r--spec/unit/resource_spec.rb2
4 files changed, 9 insertions, 9 deletions
diff --git a/spec/support/shared/unit/script_resource.rb b/spec/support/shared/unit/script_resource.rb
index 8a1f66b706..add99d45bd 100644
--- a/spec/support/shared/unit/script_resource.rb
+++ b/spec/support/shared/unit/script_resource.rb
@@ -66,14 +66,14 @@ shared_examples_for "a script resource" do
it "when guard_interpreter is set to the default value, the guard command string should be evaluated by command execution and not through a resource" do
Chef::Resource::Conditional.any_instance.should_not_receive(:evaluate_block)
Chef::Resource::Conditional.any_instance.should_receive(:evaluate_command).and_return(true)
- Chef::GuardInterpreter.any_instance.should_not_receive(:evaluate_action)
+ Chef::GuardInterpreter::ResourceGuardInterpreter.any_instance.should_not_receive(:evaluate_action)
resource.only_if 'echo hi'
resource.should_skip?(:run).should == nil
end
it "when a valid guard_interpreter resource is specified, a block should be used to evaluate the guard" do
Chef::Resource::Conditional.any_instance.should_not_receive(:evaluate_command)
- Chef::GuardInterpreter.any_instance.should_receive(:evaluate_action).and_return(true)
+ Chef::GuardInterpreter::ResourceGuardInterpreter.any_instance.should_receive(:evaluate_action).and_return(true)
resource.guard_interpreter :script
resource.only_if 'echo hi'
resource.should_skip?(:run).should == nil
diff --git a/spec/unit/resource/conditional/guard_interpreter_spec.rb b/spec/unit/guard_interpreter/resource_guard_interpreter_spec.rb
index 3f49e341dc..a016cbfeb8 100644
--- a/spec/unit/resource/conditional/guard_interpreter_spec.rb
+++ b/spec/unit/guard_interpreter/resource_guard_interpreter_spec.rb
@@ -18,7 +18,7 @@
require 'spec_helper'
-describe Chef::Resource::Conditional::GuardInterpreter do
+describe Chef::GuardInterpreter::ResourceGuardInterpreter do
before(:each) do
node = Chef::Node.new
@@ -37,13 +37,13 @@ describe Chef::Resource::Conditional::GuardInterpreter do
it "should allow guard interpreter to be set to Chef::Resource::Script" do
resource.guard_interpreter(:script)
- allow_any_instance_of(Chef::Resource::Conditional::GuardInterpreter).to receive(:evaluate_action).and_return(false)
+ allow_any_instance_of(Chef::GuardInterpreter::ResourceGuardInterpreter).to receive(:evaluate_action).and_return(false)
resource.only_if("echo hi")
end
it "should allow guard interpreter to be set to Chef::Resource::PowershellScript derived indirectly from Chef::Resource::Script" do
resource.guard_interpreter(:powershell_script)
- allow_any_instance_of(Chef::Resource::Conditional::GuardInterpreter).to receive(:evaluate_action).and_return(false)
+ allow_any_instance_of(Chef::GuardInterpreter::ResourceGuardInterpreter).to receive(:evaluate_action).and_return(false)
resource.only_if("echo hi")
end
diff --git a/spec/unit/resource/powershell_spec.rb b/spec/unit/resource/powershell_spec.rb
index 0d678e7a5a..52012a0f41 100644
--- a/spec/unit/resource/powershell_spec.rb
+++ b/spec/unit/resource/powershell_spec.rb
@@ -45,19 +45,19 @@ describe Chef::Resource::PowershellScript do
it "should allow guard interpreter to be set to Chef::Resource::Script" do
resource.guard_interpreter(:script)
- allow_any_instance_of(Chef::GuardInterpreter).to receive(:evaluate_action).and_return(false)
+ allow_any_instance_of(Chef::GuardInterpreter::ResourceGuardInterpreter).to receive(:evaluate_action).and_return(false)
resource.only_if("echo hi")
end
it "should allow guard interpreter to be set to Chef::Resource::Bash derived from Chef::Resource::Script" do
resource.guard_interpreter(:bash)
- allow_any_instance_of(Chef::GuardInterpreter).to receive(:evaluate_action).and_return(false)
+ allow_any_instance_of(Chef::GuardInterpreter::ResourceGuardInterpreter).to receive(:evaluate_action).and_return(false)
resource.only_if("echo hi")
end
it "should allow guard interpreter to be set to Chef::Resource::PowershellScript derived indirectly from Chef::Resource::Script" do
resource.guard_interpreter(:powershell_script)
- allow_any_instance_of(Chef::GuardInterpreter).to receive(:evaluate_action).and_return(false)
+ allow_any_instance_of(Chef::GuardInterpreter::ResourceGuardInterpreter).to receive(:evaluate_action).and_return(false)
resource.only_if("echo hi")
end
end
diff --git a/spec/unit/resource_spec.rb b/spec/unit/resource_spec.rb
index 8b46e56fcb..60f3bdb8ea 100644
--- a/spec/unit/resource_spec.rb
+++ b/spec/unit/resource_spec.rb
@@ -543,7 +543,7 @@ describe Chef::Resource do
end
it "should not raise an exception when setting the guard interpreter attribute to a Symbol" do
- Chef::GuardInterpreter.stub(:new).and_return(nil)
+ Chef::GuardInterpreter::ResourceGuardInterpreter.stub(:new).and_return(nil)
expect { resource.guard_interpreter(:command_dot_com) }.not_to raise_error
end
end