Skip to content

Commit

Permalink
Added --/++ markers around the dice class.
Browse files Browse the repository at this point in the history
  • Loading branch information
jimweirich committed Dec 23, 2010
1 parent 0b9727f commit 3dab146
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
11 changes: 5 additions & 6 deletions koans/about_dice_project.rb
@@ -1,11 +1,10 @@
require File.expand_path(File.dirname(__FILE__) + '/edgecase')

class DiceSet
attr_reader :values
def roll(n)
@values = (1..n).map { rand(6) + 1 }
end
end
# Implement a DiceSet Class here:
#
# class DiceSet
# code ...
# end

class AboutDiceProject < EdgeCase::Koan
def test_can_create_a_dice_set
Expand Down
8 changes: 8 additions & 0 deletions src/about_dice_project.rb
@@ -1,12 +1,20 @@
require File.expand_path(File.dirname(__FILE__) + '/edgecase')

# Implement a DiceSet Class here:
#
# class DiceSet
# code ...
# end

#--
class DiceSet
attr_reader :values
def roll(n)
@values = (1..n).map { rand(6) + 1 }
end
end

#++
class AboutDiceProject < EdgeCase::Koan
def test_can_create_a_dice_set
dice = DiceSet.new
Expand Down

0 comments on commit 3dab146

Please sign in to comment.