summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2012-06-28 10:58:59 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2012-06-28 10:58:59 +0200
commit1f02d0091d40cde8790ef1e7e630e97978be293f (patch)
treed33aca3f52b61fabc45f9a1830edbf3b94459d70
parent38efe8f87d47915364f426eac41e465b4bdff279 (diff)
downloadedoors-ruby-1f02d0091d40cde8790ef1e7e630e97978be293f.zip
edoors-ruby-1f02d0091d40cde8790ef1e7e630e97978be293f.tar.gz
specs: cover Edoors::ACT_PASS_THROUGH
-rw-r--r--spec/board_spec.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/spec/board_spec.rb b/spec/board_spec.rb
index 1b2e0c4..7bed245 100644
--- a/spec/board_spec.rb
+++ b/spec/board_spec.rb
@@ -40,10 +40,13 @@ describe Edoors::Board do
P0 = p0
P1 = p1
class Board0 < Edoors::Board
- attr_reader :ok, :follow
+ attr_reader :ok, :follow, :pass_through
def receive_p p
@ok = false
+ @pass_through = false
case p.action
+ when Edoors::ACT_PASS_THROUGH
+ @pass_through = true
when Edoors::ACT_FOLLOW
@follow = true
@ok = (p===P0 and p.merged(0)===P1)
@@ -72,6 +75,10 @@ describe Edoors::Board do
b0.process_p p1
b0.ok.should be_true
b0.follow.should be_true
+ p2 = b0.require_p
+ p2.set_dst! Edoors::ACT_PASS_THROUGH, b0
+ b0.process_p p2
+ b0.pass_through.should be true
end
#
it "board->json->board" do