diff options
| author | Daniel Pittman <daniel@puppetlabs.com> | 2011-04-04 14:34:51 -0700 |
|---|---|---|
| committer | Daniel Pittman <daniel@puppetlabs.com> | 2011-04-04 14:35:13 -0700 |
| commit | 4d2a367b0cf5bf03588b1e6bbfafdf437bea249e (patch) | |
| tree | 6f731f99d1e0e51ee4ba613851cc49b90633b27f /spec/unit/string/action_spec.rb | |
| parent | 75ef3af26fcd205f316358b2f23abe5e200f6eaf (diff) | |
| download | puppet-4d2a367b0cf5bf03588b1e6bbfafdf437bea249e.tar.gz puppet-4d2a367b0cf5bf03588b1e6bbfafdf437bea249e.tar.xz puppet-4d2a367b0cf5bf03588b1e6bbfafdf437bea249e.zip | |
(#6964) use 'when_invoked' rather than 'invoke' for actions.
In the DSL we want to use 'when_invoked do' because it reads much more
naturally for users.
Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
Diffstat (limited to 'spec/unit/string/action_spec.rb')
| -rwxr-xr-x | spec/unit/string/action_spec.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/spec/unit/string/action_spec.rb b/spec/unit/string/action_spec.rb index 1d25ff156..b6fe87a63 100755 --- a/spec/unit/string/action_spec.rb +++ b/spec/unit/string/action_spec.rb @@ -17,11 +17,11 @@ describe Puppet::String::Action do it "should be able to call other actions on the same object" do string = Puppet::String.new(:my_string, '0.0.1') do action(:foo) do - invoke { 25 } + when_invoked { 25 } end action(:bar) do - invoke { "the value of foo is '#{foo}'" } + when_invoked { "the value of foo is '#{foo}'" } end end string.foo.should == 25 @@ -35,25 +35,25 @@ describe Puppet::String::Action do it "should be able to call other actions on the same object when defined on a class" do class Puppet::String::MyStringBaseClass < Puppet::String action(:foo) do - invoke { 25 } + when_invoked { 25 } end action(:bar) do - invoke { "the value of foo is '#{foo}'" } + when_invoked { "the value of foo is '#{foo}'" } end action(:quux) do - invoke { "qux told me #{qux}" } + when_invoked { "qux told me #{qux}" } end end string = Puppet::String::MyStringBaseClass.new(:my_inherited_string, '0.0.1') do action(:baz) do - invoke { "the value of foo in baz is '#{foo}'" } + when_invoked { "the value of foo in baz is '#{foo}'" } end action(:qux) do - invoke { baz } + when_invoked { baz } end end string.foo.should == 25 @@ -67,7 +67,7 @@ describe Puppet::String::Action do let :string do Puppet::String.new(:ruby_api, '1.0.0') do action :bar do - invoke do |options| + when_invoked do |options| options end end |
