mirror of
https://github.com/edgecase/ruby_koans.git
synced 2026-04-15 07:23:19 -04:00
Added --/++ markers around the dice class.
This commit is contained in:
@@ -1,11 +1,10 @@
|
|||||||
require File.expand_path(File.dirname(__FILE__) + '/edgecase')
|
require File.expand_path(File.dirname(__FILE__) + '/edgecase')
|
||||||
|
|
||||||
class DiceSet
|
# Implement a DiceSet Class here:
|
||||||
attr_reader :values
|
#
|
||||||
def roll(n)
|
# class DiceSet
|
||||||
@values = (1..n).map { rand(6) + 1 }
|
# code ...
|
||||||
end
|
# end
|
||||||
end
|
|
||||||
|
|
||||||
class AboutDiceProject < EdgeCase::Koan
|
class AboutDiceProject < EdgeCase::Koan
|
||||||
def test_can_create_a_dice_set
|
def test_can_create_a_dice_set
|
||||||
|
|||||||
@@ -1,5 +1,12 @@
|
|||||||
require File.expand_path(File.dirname(__FILE__) + '/edgecase')
|
require File.expand_path(File.dirname(__FILE__) + '/edgecase')
|
||||||
|
|
||||||
|
# Implement a DiceSet Class here:
|
||||||
|
#
|
||||||
|
# class DiceSet
|
||||||
|
# code ...
|
||||||
|
# end
|
||||||
|
|
||||||
|
#--
|
||||||
class DiceSet
|
class DiceSet
|
||||||
attr_reader :values
|
attr_reader :values
|
||||||
def roll(n)
|
def roll(n)
|
||||||
@@ -7,6 +14,7 @@ class DiceSet
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#++
|
||||||
class AboutDiceProject < EdgeCase::Koan
|
class AboutDiceProject < EdgeCase::Koan
|
||||||
def test_can_create_a_dice_set
|
def test_can_create_a_dice_set
|
||||||
dice = DiceSet.new
|
dice = DiceSet.new
|
||||||
|
|||||||
Reference in New Issue
Block a user