summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/mastermind/game_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/mastermind/game_spec.rb b/spec/mastermind/game_spec.rb
index 4788aa9..dd14dc8 100644
--- a/spec/mastermind/game_spec.rb
+++ b/spec/mastermind/game_spec.rb
@@ -40,5 +40,21 @@ module Mastermind
end
end
end
+ context "with duplicates in the guess that match a peg in the code" do
+ context "by color and position" do
+ it "should add a single b to the mark" do
+ @game.start(%w[r y g c])
+ @messenger.should_receive(:puts).with("bbb")
+ @game.guess(%w[r y g g])
+ end
+ end
+ end
+ context "with three colors correct in the correct places" do
+ it "should mark the guess with bbb" do
+ @game.start(%w[r g y c])
+ @messenger.should_receive(:puts).with("bbb")
+ @game.guess(%w[r g y w])
+ end
+ end
end
end