summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel DeLeo <dan@opscode.com>2010-06-28 17:08:16 -0700
committerDaniel DeLeo <dan@opscode.com>2010-06-28 17:08:16 -0700
commit949fc3f093399ceeeb96e341f7ffe2780a4f53fa (patch)
tree49876b037614526f9c206467fbb9b9866a4f9205
parentba39367ac434f1804e19133a30343cbde76490cf (diff)
parent483a6f8915f87c6b37533568d11f43b131350ec2 (diff)
downloadchef-949fc3f093399ceeeb96e341f7ffe2780a4f53fa.tar.gz
Merge branch 'cuke-include-default-attribute'
-rw-r--r--features/data/cookbooks/attribute_include_default/README.rdoc8
-rw-r--r--features/data/cookbooks/attribute_include_default/attributes/a.rb5
-rw-r--r--features/data/cookbooks/attribute_include_default/attributes/default.rb2
-rw-r--r--features/data/cookbooks/attribute_include_default/metadata.rb6
-rw-r--r--features/data/cookbooks/attribute_include_default/recipes/default.rb23
-rw-r--r--features/language/attribute_inclusion.feature8
6 files changed, 52 insertions, 0 deletions
diff --git a/features/data/cookbooks/attribute_include_default/README.rdoc b/features/data/cookbooks/attribute_include_default/README.rdoc
new file mode 100644
index 0000000000..8d774805b9
--- /dev/null
+++ b/features/data/cookbooks/attribute_include_default/README.rdoc
@@ -0,0 +1,8 @@
+= DESCRIPTION:
+
+= REQUIREMENTS:
+
+= ATTRIBUTES:
+
+= USAGE:
+
diff --git a/features/data/cookbooks/attribute_include_default/attributes/a.rb b/features/data/cookbooks/attribute_include_default/attributes/a.rb
new file mode 100644
index 0000000000..53b60c55de
--- /dev/null
+++ b/features/data/cookbooks/attribute_include_default/attributes/a.rb
@@ -0,0 +1,5 @@
+# should be equivalent to include_attribute 'attribute_include_default::default'
+include_attribute 'attribute_include_default'
+set[:mars_volta] = mars_volta_name
+set[:mars_volta_is] = mars_volta_will_be
+
diff --git a/features/data/cookbooks/attribute_include_default/attributes/default.rb b/features/data/cookbooks/attribute_include_default/attributes/default.rb
new file mode 100644
index 0000000000..bd5e056c04
--- /dev/null
+++ b/features/data/cookbooks/attribute_include_default/attributes/default.rb
@@ -0,0 +1,2 @@
+set[:mars_volta_name] = 'mars_volta'
+set[:mars_volta_will_be] = 'dope'
diff --git a/features/data/cookbooks/attribute_include_default/metadata.rb b/features/data/cookbooks/attribute_include_default/metadata.rb
new file mode 100644
index 0000000000..07c1801d28
--- /dev/null
+++ b/features/data/cookbooks/attribute_include_default/metadata.rb
@@ -0,0 +1,6 @@
+maintainer "Opscode"
+maintainer_email "do_not_reply@opscode.com"
+license "Apache 2.0"
+description "Installs/Configures recipe_include"
+long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
+version "0.1"
diff --git a/features/data/cookbooks/attribute_include_default/recipes/default.rb b/features/data/cookbooks/attribute_include_default/recipes/default.rb
new file mode 100644
index 0000000000..a211dc5928
--- /dev/null
+++ b/features/data/cookbooks/attribute_include_default/recipes/default.rb
@@ -0,0 +1,23 @@
+#
+# Cookbook Name:: recipe_include
+# Recipe:: second
+#
+# Copyright 2009, Opscode
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+execute "append to #{node[:tmpdir]}/mars_volta" do
+ command "echo '#{node.mars_volta} is #{node.mars_volta_is}' >> #{node[:tmpdir]}/mars_volta"
+end
+
diff --git a/features/language/attribute_inclusion.feature b/features/language/attribute_inclusion.feature
index d5e8c992c7..a98d5caae9 100644
--- a/features/language/attribute_inclusion.feature
+++ b/features/language/attribute_inclusion.feature
@@ -11,3 +11,11 @@ Feature: Attribute Inclusion
Then the run should exit '0'
And a file named 'mars_volta' should contain 'mars_volta is dope' only '1' time
+ @fuuu
+ Scenario: Include a default attribute file
+ Given a validated node
+ And it includes the recipe 'attribute_include_default'
+ When I run the chef-client
+ Then the run should exit '0'
+ And a file named 'mars_volta' should contain 'mars_volta is dope' only '1' time
+