SandBox

2005-11-16 15:11:22 +0900 (6738d); rev 4

class Dollar

  attr_reader :amount

  def initialize(amount)
    @amount = 10
  end

  def times(multiplier)
  end

end


if $0 == __FILE__
  require 'test/unit'

  class TestMoney < Test::Unit::TestCase

    def test_multiplication
      five = Dollar.new(5)
      five.times(2)
      assert_equal(10, five.amount)
    end

  end
end

テスト用のページです。 好きに使ってください。


system revision 1.162