summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2012-05-14 18:37:52 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2012-05-14 18:37:52 +0200
commitcfaf554a3e73935b8612e1a003d89fff4c21ac7e (patch)
treeaf79eb5187d466f07204b360ba311d3faac121b4
parent1502352b31032cda4b4e555613105edf83584c18 (diff)
downloadedoors-ruby-cfaf554a3e73935b8612e1a003d89fff4c21ac7e.zip
edoors-ruby-cfaf554a3e73935b8612e1a003d89fff4c21ac7e.tar.gz
specs: add NoMethodError when receive_p is not overriden
-rw-r--r--spec/door_spec.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/door_spec.rb b/spec/door_spec.rb
index 72e28a9..254d59c 100644
--- a/spec/door_spec.rb
+++ b/spec/door_spec.rb
@@ -27,6 +27,15 @@ describe EvenDoors::Door do
(p0===p2).should be_true
end
#
+ it "NoMethodError when receive_p not overridden" do
+ class Door0 < EvenDoors::Door
+ end
+ f = Fake.new 'fake', @spin
+ d0 = Door0.new 'door0', f
+ p0 = d0.require_p EvenDoors::Particle
+ lambda { d0.process_p p0 }.should raise_error(NoMethodError)
+ end
+ #
it "send_p, send_sys_p, release_p and release of lost particles" do
class Door0 < EvenDoors::Door
def receive_p p