refactored the SlotLoad into SlotDefs
That sort of removes the last horrible code. Surely can still be improved, but mostly oo now
This commit is contained in:
@ -3,19 +3,22 @@ require_relative "helper"
|
||||
module SlotMachine
|
||||
class TestSlotLoadBasics < MiniTest::Test
|
||||
|
||||
def setup
|
||||
Parfait.boot!({})
|
||||
end
|
||||
def test_ins_ok
|
||||
assert SlotLoad.new("test", [:message, :caller] , [:receiver,:type] )
|
||||
assert SlotLoad.new("test", [:message, :caller] , [:message , :receiver,:type] )
|
||||
end
|
||||
def test_ins_fail1
|
||||
assert_raises {SlotLoad.new( "test",[:message, :caller] , nil )}
|
||||
end
|
||||
def test_fail_on_right
|
||||
@load = SlotLoad.new( "test",[:message, :caller] , [:receiver,:type] )
|
||||
assert_raises {@load.to_risc(Risc::FakeCompiler.new)}
|
||||
def pest_fail_on_right
|
||||
load = SlotLoad.new( "test",[:message, :caller] , [:message ,:receiver,:type] )
|
||||
assert_raises {load.to_risc(Risc::FakeCompiler.new)}
|
||||
end
|
||||
def test_fail_on_left_long
|
||||
@load = SlotLoad.new("test", [:message, :caller , :type] , [:receiver,:type] )
|
||||
assert_raises {@load.to_risc(Risc::FakeCompiler.new)}
|
||||
def pest_fail_on_left_long
|
||||
load = SlotLoad.new("test", [:message, :caller , :type , :type] , [:message,:type] )
|
||||
assert_raises {load.to_risc(Risc::FakeCompiler.new)}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user