diff options
author | Seth Chisamore <schisamo@opscode.com> | 2012-10-30 10:39:35 -0400 |
---|---|---|
committer | Seth Chisamore <schisamo@opscode.com> | 2012-10-30 10:39:35 -0400 |
commit | 24dc69a9a97e82a6e4207de68d6dcc664178249b (patch) | |
tree | 19bb289c9f88b4bbab066bc56b95d6d222fd5c35 /spec/data/lwrp | |
parent | 9348c1c9c80ee757354d624b7dc1b78ebc7605c4 (diff) | |
download | chef-24dc69a9a97e82a6e4207de68d6dcc664178249b.tar.gz |
[OC-3564] move core Chef to the repo root \o/ \m/
The opscode/chef repository now only contains the core Chef library code
used by chef-client, knife and chef-solo!
Diffstat (limited to 'spec/data/lwrp')
-rw-r--r-- | spec/data/lwrp/providers/buck_passer.rb | 3 | ||||
-rw-r--r-- | spec/data/lwrp/providers/buck_passer_2.rb | 10 | ||||
-rw-r--r-- | spec/data/lwrp/providers/embedded_resource_accesses_providers_scope.rb | 16 | ||||
-rw-r--r-- | spec/data/lwrp/providers/monkey_name_printer.rb | 5 | ||||
-rw-r--r-- | spec/data/lwrp/providers/paint_drying_watcher.rb | 7 | ||||
-rw-r--r-- | spec/data/lwrp/providers/thumb_twiddler.rb | 7 | ||||
-rw-r--r-- | spec/data/lwrp/resources/bar.rb | 1 | ||||
-rw-r--r-- | spec/data/lwrp/resources/foo.rb | 3 | ||||
-rw-r--r-- | spec/data/lwrp/resources_with_default_attributes/nodeattr.rb | 1 |
9 files changed, 53 insertions, 0 deletions
diff --git a/spec/data/lwrp/providers/buck_passer.rb b/spec/data/lwrp/providers/buck_passer.rb new file mode 100644 index 0000000000..1f83e5098b --- /dev/null +++ b/spec/data/lwrp/providers/buck_passer.rb @@ -0,0 +1,3 @@ +action :buck_stops_here do + log "This should be overwritten by ../lwrp_override/buck_passer.rb" +end diff --git a/spec/data/lwrp/providers/buck_passer_2.rb b/spec/data/lwrp/providers/buck_passer_2.rb new file mode 100644 index 0000000000..d34da3c378 --- /dev/null +++ b/spec/data/lwrp/providers/buck_passer_2.rb @@ -0,0 +1,10 @@ +action :pass_buck do + lwrp_bar :prepared_eyes do + action :prepare_eyes + provider :lwrp_paint_drying_watcher + end + lwrp_bar :dried_paint_watched do + action :watch_paint_dry + provider :lwrp_paint_drying_watcher + end +end diff --git a/spec/data/lwrp/providers/embedded_resource_accesses_providers_scope.rb b/spec/data/lwrp/providers/embedded_resource_accesses_providers_scope.rb new file mode 100644 index 0000000000..f5841fb01c --- /dev/null +++ b/spec/data/lwrp/providers/embedded_resource_accesses_providers_scope.rb @@ -0,0 +1,16 @@ +# This action tests that embedded Resources have access to the enclosing Provider's +# lexical scope (as demonstrated by the call to new_resource) and that all parameters +# are passed properly (as demonstrated by the call to generate_new_name). +attr_reader :enclosed_resource + +action :twiddle_thumbs do + @enclosed_resource = lwrp_foo :foo do + monkey generate_new_name(new_resource.monkey){ 'the monkey' } + action :twiddle_thumbs + provider :lwrp_monkey_name_printer + end +end + +def generate_new_name(str, &block) + "#{str}, #{block.call}" +end diff --git a/spec/data/lwrp/providers/monkey_name_printer.rb b/spec/data/lwrp/providers/monkey_name_printer.rb new file mode 100644 index 0000000000..97ca66c65d --- /dev/null +++ b/spec/data/lwrp/providers/monkey_name_printer.rb @@ -0,0 +1,5 @@ +attr_reader :monkey_name + +action :twiddle_thumbs do + @monkey_name = "my monkey's name is '#{new_resource.monkey}'" +end diff --git a/spec/data/lwrp/providers/paint_drying_watcher.rb b/spec/data/lwrp/providers/paint_drying_watcher.rb new file mode 100644 index 0000000000..04b4732dcc --- /dev/null +++ b/spec/data/lwrp/providers/paint_drying_watcher.rb @@ -0,0 +1,7 @@ +action :prepare_eyes do + "Prepared" +end + +action :watch_paint_dry do + "This isn't very interesting" +end diff --git a/spec/data/lwrp/providers/thumb_twiddler.rb b/spec/data/lwrp/providers/thumb_twiddler.rb new file mode 100644 index 0000000000..7f014615db --- /dev/null +++ b/spec/data/lwrp/providers/thumb_twiddler.rb @@ -0,0 +1,7 @@ +action :prepare_thumbs do + "Prepared" +end + +action :twiddle_thumbs do + "Twiddle twiddle" +end diff --git a/spec/data/lwrp/resources/bar.rb b/spec/data/lwrp/resources/bar.rb new file mode 100644 index 0000000000..bded6eeac3 --- /dev/null +++ b/spec/data/lwrp/resources/bar.rb @@ -0,0 +1 @@ +actions :pass_buck, :prepare_eyes, :watch_paint_dry diff --git a/spec/data/lwrp/resources/foo.rb b/spec/data/lwrp/resources/foo.rb new file mode 100644 index 0000000000..c881c80530 --- /dev/null +++ b/spec/data/lwrp/resources/foo.rb @@ -0,0 +1,3 @@ +actions :never_execute + +attribute :ever, :kind_of => String diff --git a/spec/data/lwrp/resources_with_default_attributes/nodeattr.rb b/spec/data/lwrp/resources_with_default_attributes/nodeattr.rb new file mode 100644 index 0000000000..dece7c4eab --- /dev/null +++ b/spec/data/lwrp/resources_with_default_attributes/nodeattr.rb @@ -0,0 +1 @@ +attribute :penguin, :kind_of => String, :default => node[:penguin_name] |