2018-05-15 18:29:27 +02:00
|
|
|
require_relative "helper"
|
|
|
|
|
2019-10-03 19:55:41 +02:00
|
|
|
module SlotMachine
|
2020-02-17 08:27:42 +01:00
|
|
|
class TestSlottedMessage < MiniTest::Test
|
2018-05-15 18:29:27 +02:00
|
|
|
|
2020-02-17 08:45:54 +01:00
|
|
|
def slotted(slot = [:caller])
|
2020-02-15 15:02:03 +01:00
|
|
|
SlottedMessage.new(slot)
|
2018-05-15 18:29:27 +02:00
|
|
|
end
|
|
|
|
def test_create_ok1
|
2020-02-17 08:27:42 +01:00
|
|
|
assert_equal :message , slotted.known_object
|
2018-05-15 18:29:27 +02:00
|
|
|
end
|
|
|
|
def test_create_ok2
|
2020-02-17 08:27:42 +01:00
|
|
|
assert_equal Slot , slotted.slots.class
|
|
|
|
assert_equal :caller , slotted.slots.name
|
2018-06-16 20:01:15 +02:00
|
|
|
end
|
2018-05-15 18:29:27 +02:00
|
|
|
def test_create_fail_none
|
2020-02-17 08:27:42 +01:00
|
|
|
assert_raises {slotted(nil)}
|
2018-05-15 18:29:27 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|