spec/lib/soloist/config_spec.rb in soloist-1.0.2 vs spec/lib/soloist/config_spec.rb in soloist-1.0.3
- old
+ new
@@ -107,10 +107,14 @@
let(:switch) do
{
"TONGUES" => {
"FINE" => {
"recipes" => ["hobo_fist"],
+ "cookbook_paths" => ["shell_in"],
+ "node_attributes" => {
+ "doc" => "absent"
+ },
"env_variable_switches" => nested
}
}
}
end
@@ -130,22 +134,31 @@
it "merges the attributes" do
config.compiled.recipes.should =~ ["hobo_fist"]
end
+ it "merges the node attributes" do
+ config.compiled.node_attributes.should == {"doc" => "absent"}
+ end
+
context "when an inactive switch is nested" do
let(:nested) { {"BEANS" => {"EW" => {"recipes" => ["slammin"]}}} }
it "does not merge the attributes" do
config.compiled.recipes.should =~ ["hobo_fist"]
end
end
context "when an active switch is nested" do
- let(:nested) { {"BEANS" => {"FINE" => {"recipes" => ["slammin"]}}} }
+ let(:nested) { {"BEANS" => {"FINE" => {"cookbook_paths" => ["shell_out"], "recipes" => ["slammin"], "node_attributes" => {"kocher" => "present"}}}} }
it "merges the attributes" do
- config.compiled.recipes.should =~ ["slammin"]
+ config.compiled.recipes.should =~ ["slammin", "hobo_fist"]
+ config.compiled.cookbook_paths.should =~ ["shell_in", "shell_out"]
+ end
+
+ it "merges the node attributes" do
+ config.compiled.node_attributes.should == {"doc" => "absent", "kocher" => "present"}
end
end
end
end