Last active
August 29, 2015 13:57
-
-
Save cromwellryan/9513580 to your computer and use it in GitHub Desktop.
This file contains 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_relative 'dice' | |
require 'minitest/spec' | |
require 'minitest/autorun' | |
describe Dice do | |
before do | |
@new_roll = Dice.new | |
end | |
describe "rolling 5 dice" do | |
before { @result = @new_roll.hashing([1,3,1,1,5]) } | |
it "counts how many times each number comes up" do | |
@result.must_equal ({1=>3, 3=>1, 5=>1}) | |
end | |
end | |
describe "when asked if there is a set of 3 repeated results" do | |
before { @result = @new_roll.set_of_three([1,3,5,1,1]) } | |
it "will remove the set if it exists" do | |
@result.must_equal ({1=>0, 3=>1, 5=>1}) | |
end | |
end | |
describe "when asked about the total score" do | |
before { @result = @new_roll.score([1,3,1,1,1]) } | |
it "will calculate total score for 1 game" do | |
@result.must_equal 1100 | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment