summaryrefslogtreecommitdiffstats
path: root/spec/unit/relationship.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/relationship.rb')
-rwxr-xr-xspec/unit/relationship.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/unit/relationship.rb b/spec/unit/relationship.rb
index 6aa11ad9f..fd7e0aaf7 100755
--- a/spec/unit/relationship.rb
+++ b/spec/unit/relationship.rb
@@ -72,6 +72,16 @@ describe Puppet::Relationship, " when initializing" do
@edge.callback.should == :foo
@edge.event.should == :bar
end
+
+ it "should accept events specified as strings" do
+ @edge = Puppet::Relationship.new(:a, :b, "event" => :NONE)
+ @edge.event.should == :NONE
+ end
+
+ it "should accept callbacks specified as strings" do
+ @edge = Puppet::Relationship.new(:a, :b, "callback" => :foo)
+ @edge.callback.should == :foo
+ end
end
describe Puppet::Relationship, " when matching edges with no specified event" do
@@ -227,6 +237,10 @@ describe Puppet::Relationship, "when converting from json" do
Puppet::Relationship.expects(:new).with { |*args| yield args }
end
+ it "should be extended with the JSON utility module" do
+ Puppet::Relationship.metaclass.ancestors.should be_include(Puppet::Util::Json)
+ end
+
# LAK:NOTE For all of these tests, we convert back to the edge so we can
# trap the actual data structure then.
it "should pass the source in as the first argument" do