Torsten Rüger
6aa6b32c50
since it is not an instruction, just a helper also doing this before rewriting slot recursively
24 lines
511 B
Ruby
24 lines
511 B
Ruby
require_relative "helper"
|
|
|
|
module SlotMachine
|
|
class TestSlotBasics < MiniTest::Test
|
|
|
|
def slot(slot = :caller)
|
|
MessageSlot.new(slot)
|
|
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
|
|
def test_to_s
|
|
assert_equal "[message, caller]" , slot.to_s
|
|
end
|
|
def test_create_fail_none
|
|
assert_raises {slot(nil)}
|
|
end
|
|
end
|
|
end
|