rubyx/test/slot_machine/instruction/test_message_slot.rb

24 lines
511 B
Ruby
Raw Normal View History

2018-05-15 18:29:27 +02:00
require_relative "helper"
module SlotMachine
class TestSlotBasics < MiniTest::Test
2018-05-15 18:29:27 +02:00
def slot(slot = :caller)
MessageSlot.new(slot)
2018-05-15 18:29:27 +02:00
end
def test_create_ok1
assert_equal :message , slot.known_object
end
def test_create_ok2
assert_equal Array , slot.slots.class
assert_equal :caller , slot.slots.first
end
2018-06-16 20:01:15 +02:00
def test_to_s
assert_equal "[message, caller]" , slot.to_s
2018-06-16 20:01:15 +02:00
end
2018-05-15 18:29:27 +02:00
def test_create_fail_none
assert_raises {slot(nil)}
end
end
end