Created
February 21, 2013 23:48
-
-
Save zankich/5009544 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class CodeBreaker | |
| def evaluate_guess(colors) | |
| [] | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require "./code_breaker" | |
| describe CodeBreaker do | |
| it "should load codebreaker" do | |
| c = CodeBreaker.new | |
| c.nil?.should eq(false) | |
| end | |
| specify "no matches return empty array" do | |
| c = CodeBreaker.new | |
| matches = c.evaluate_guess([:red, :green, :blue, :yellow]) | |
| matches.should eq([]) | |
| end | |
| specify "matches one place" do | |
| c = CodeBreaker.new | |
| matches = c.evaluate_guess([:red, :green, :blue, :yellow]) | |
| matches.should eq([:place]) | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment