summaryrefslogtreecommitdiffstats
path: root/spec/unit/string
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/string')
-rwxr-xr-xspec/unit/string/action_builder_spec.rb2
-rwxr-xr-xspec/unit/string/action_manager_spec.rb50
-rwxr-xr-xspec/unit/string/action_spec.rb16
3 files changed, 34 insertions, 34 deletions
diff --git a/spec/unit/string/action_builder_spec.rb b/spec/unit/string/action_builder_spec.rb
index fde010d51..5f6f1c08f 100755
--- a/spec/unit/string/action_builder_spec.rb
+++ b/spec/unit/string/action_builder_spec.rb
@@ -15,7 +15,7 @@ describe Puppet::String::ActionBuilder do
it "should define a method on the string which invokes the action" do
string = Puppet::String.new(:action_builder_test_string, '0.0.1')
action = Puppet::String::ActionBuilder.build(string, :foo) do
- invoke do
+ when_invoked do
"invoked the method"
end
end
diff --git a/spec/unit/string/action_manager_spec.rb b/spec/unit/string/action_manager_spec.rb
index 5ca55b387..b8baf80a5 100755
--- a/spec/unit/string/action_manager_spec.rb
+++ b/spec/unit/string/action_manager_spec.rb
@@ -15,7 +15,7 @@ describe Puppet::String::ActionManager do
describe "when included in a class" do
it "should be able to define an action" do
subject.action(:foo) do
- invoke { "something "}
+ when_invoked { "something "}
end
end
@@ -27,10 +27,10 @@ describe Puppet::String::ActionManager do
it "should be able to list defined actions" do
subject.action(:foo) do
- invoke { "something" }
+ when_invoked { "something" }
end
subject.action(:bar) do
- invoke { "something" }
+ when_invoked { "something" }
end
subject.actions.should =~ [:foo, :bar]
@@ -43,7 +43,7 @@ describe Puppet::String::ActionManager do
it "should list both script and normal actions" do
subject.action :foo do
- invoke do "foo" end
+ when_invoked do "foo" end
end
subject.script :bar do "a bar is where beer is found" end
@@ -52,7 +52,7 @@ describe Puppet::String::ActionManager do
it "should be able to indicate when an action is defined" do
subject.action(:foo) do
- invoke { "something" }
+ when_invoked { "something" }
end
subject.should be_action(:foo)
@@ -65,7 +65,7 @@ describe Puppet::String::ActionManager do
it "should correctly treat action names specified as strings" do
subject.action(:foo) do
- invoke { "something" }
+ when_invoked { "something" }
end
subject.should be_action("foo")
@@ -77,16 +77,16 @@ describe Puppet::String::ActionManager do
it "should be able to define an action" do
subject.action(:foo) do
- invoke { "something "}
+ when_invoked { "something "}
end
end
it "should be able to list defined actions" do
subject.action(:foo) do
- invoke { "something" }
+ when_invoked { "something" }
end
subject.action(:bar) do
- invoke { "something" }
+ when_invoked { "something" }
end
subject.actions.should include(:bar)
@@ -110,36 +110,36 @@ describe Puppet::String::ActionManager do
it "should be able to define an action at the class level" do
@klass.action(:foo) do
- invoke { "something "}
+ when_invoked { "something "}
end
end
it "should create an instance method when an action is defined at the class level" do
@klass.action(:foo) do
- invoke { "something" }
+ when_invoked { "something" }
end
@instance.foo.should == "something"
end
it "should be able to define an action at the instance level" do
@instance.action(:foo) do
- invoke { "something "}
+ when_invoked { "something "}
end
end
it "should create an instance method when an action is defined at the instance level" do
@instance.action(:foo) do
- invoke { "something" }
+ when_invoked { "something" }
end
@instance.foo.should == "something"
end
it "should be able to list actions defined at the class level" do
@klass.action(:foo) do
- invoke { "something" }
+ when_invoked { "something" }
end
@klass.action(:bar) do
- invoke { "something" }
+ when_invoked { "something" }
end
@klass.actions.should include(:bar)
@@ -148,10 +148,10 @@ describe Puppet::String::ActionManager do
it "should be able to list actions defined at the instance level" do
@instance.action(:foo) do
- invoke { "something" }
+ when_invoked { "something" }
end
@instance.action(:bar) do
- invoke { "something" }
+ when_invoked { "something" }
end
@instance.actions.should include(:bar)
@@ -160,10 +160,10 @@ describe Puppet::String::ActionManager do
it "should be able to list actions defined at both instance and class level" do
@klass.action(:foo) do
- invoke { "something" }
+ when_invoked { "something" }
end
@instance.action(:bar) do
- invoke { "something" }
+ when_invoked { "something" }
end
@instance.actions.should include(:bar)
@@ -172,14 +172,14 @@ describe Puppet::String::ActionManager do
it "should be able to indicate when an action is defined at the class level" do
@klass.action(:foo) do
- invoke { "something" }
+ when_invoked { "something" }
end
@instance.should be_action(:foo)
end
it "should be able to indicate when an action is defined at the instance level" do
@klass.action(:foo) do
- invoke { "something" }
+ when_invoked { "something" }
end
@instance.should be_action(:foo)
end
@@ -189,13 +189,13 @@ describe Puppet::String::ActionManager do
@instance = @subclass.new
@klass.action(:parent) do
- invoke { "a" }
+ when_invoked { "a" }
end
@subclass.action(:sub) do
- invoke { "a" }
+ when_invoked { "a" }
end
@instance.action(:instance) do
- invoke { "a" }
+ when_invoked { "a" }
end
@instance.should be_action(:parent)
@@ -208,7 +208,7 @@ describe Puppet::String::ActionManager do
@instance = @subclass.new
@klass.action(:foo) do
- invoke { "something" }
+ when_invoked { "something" }
end
@instance.foo.should == "something"
end
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