summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2012-05-08 23:43:54 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2012-05-08 23:43:54 +0200
commit565060421d086fdc8e5f58179b45181b11b5cd63 (patch)
tree36db5873e7b130225f4497f919015b3edf4c4716
parent6c0975a3771171ff5ee611d29ef101c189440947 (diff)
downloadedoors-ruby-565060421d086fdc8e5f58179b45181b11b5cd63.zip
edoors-ruby-565060421d086fdc8e5f58179b45181b11b5cd63.tar.gz
Link: add nil default values to initialize
-rw-r--r--lib/evendoors/link.rb2
-rw-r--r--spec/evendoors_spec.rb6
2 files changed, 7 insertions, 1 deletions
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