diff options
Diffstat (limited to 'spec/data/lwrp/providers')
-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 |
6 files changed, 48 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 |