From 565060421d086fdc8e5f58179b45181b11b5cd63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 8 May 2012 23:43:54 +0200 Subject: Link: add nil default values to initialize --- lib/evendoors/link.rb | 2 +- spec/evendoors_spec.rb | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/evendoors/link.rb b/lib/evendoors/link.rb index b2a9bba..d871f1c 100644 --- a/lib/evendoors/link.rb +++ b/lib/evendoors/link.rb @@ -6,7 +6,7 @@ module EvenDoors # class Link # - def initialize src, dsts, fields, cond_fields, cond_value + def initialize src, dsts, fields=nil, cond_fields=nil, cond_value=nil @src = src # link source name @dsts = dsts # , separated destinations to apply to the particle on linking success @fields = fields # , separated fields to apply to the particle on linking success diff --git a/spec/evendoors_spec.rb b/spec/evendoors_spec.rb index 259c3bc..51e193e 100644 --- a/spec/evendoors_spec.rb +++ b/spec/evendoors_spec.rb @@ -136,6 +136,12 @@ describe EvenDoors do p.merged(1).should be_nil p.merged_shift.should be o p.merged(0).should be_nil + p.merge! q + p.merge! o + p.merged(0).should be q + p.merged(1).should be o + p.clear_merged! + p.merged(0).should be_nil end # it "routing: add_dsts, next_dst and dst_routed!" do -- cgit v1.1-2-g2b99