fjord/main_test.rb
2024-03-24 22:20:46 +09:00

22 lines
452 B
Ruby

require 'minitest/autorun'
require_relative 'main'
class GateTest < Minitest::Test
def test_gate
umeda = Gate.new(:umeda)
juso = Gate.new(:juso)
ticket = Ticket.new(160)
umeda.enter(ticket)
assert juso.exit(ticket)
end
def test_umeda_to_mikuni_when_fare_is_not_enough
umeda = Gate.new(:umeda)
mikuni = Gate.new(:mikuni)
ticket = Ticket.new(160)
umeda.enter(ticket)
refute mikuni.exit(ticket)
end
end