2018-05-15 19:29:27 +03:00
|
|
|
require_relative "helper"
|
|
|
|
|
2019-10-03 20:55:41 +03:00
|
|
|
module SlotMachine
|
2020-02-11 16:19:52 +07:00
|
|
|
class TestSlotBasics < MiniTest::Test
|
2018-05-15 19:29:27 +03:00
|
|
|
|
|
|
|
def slot(slot = :caller)
|
2020-02-11 16:19:52 +07:00
|
|
|
MessageSlot.new(slot)
|
2018-05-15 19:29:27 +03: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 21:01:15 +03:00
|
|
|
def test_to_s
|
2018-07-04 09:18:55 +03:00
|
|
|
assert_equal "[message, caller]" , slot.to_s
|
2018-06-16 21:01:15 +03:00
|
|
|
end
|
2018-05-15 19:29:27 +03:00
|
|
|
def test_create_fail_none
|
|
|
|
assert_raises {slot(nil)}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|