diff options
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 + |