summaryrefslogtreecommitdiff
path: root/spec/unit/environment_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/environment_spec.rb')
-rw-r--r--spec/unit/environment_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/unit/environment_spec.rb b/spec/unit/environment_spec.rb
index 8bbf003e6a..5f9675a307 100644
--- a/spec/unit/environment_spec.rb
+++ b/spec/unit/environment_spec.rb
@@ -275,6 +275,24 @@ describe Chef::Environment do
Chef::Environment.validate_cookbook_version("= a").should == false
Chef::Environment.validate_cookbook_version("= 1.2.3.4").should == false
end
+
+ describe "in solo mode" do
+ before do
+ Chef::Config[:solo] = true
+ end
+
+ after do
+ Chef::Config[:solo] = false
+ end
+
+ it "should raise and exception" do
+ lambda {
+ Chef::Environment.validate_cookbook_version("= 1.2.3.4")
+ }.should raise_error Chef::Exceptions::IllegalVersionConstraint,
+ "Environment cookbook version constraints not allowed in chef-solo"
+ end
+ end
+
end
describe "when updating from a parameter hash" do