Mini start to the new SlotLanguage
This commit is contained in:
12
test/slot_language/helper.rb
Normal file
12
test/slot_language/helper.rb
Normal file
@ -0,0 +1,12 @@
|
||||
require_relative "../helper"
|
||||
|
||||
module SlotLanguage
|
||||
module SlotHelper
|
||||
def compile(input)
|
||||
SlotCompiler.compile(input)
|
||||
end
|
||||
def compile_class(input)
|
||||
compile.class
|
||||
end
|
||||
end
|
||||
end
|
15
test/slot_language/test_slot_compiler.rb
Normal file
15
test/slot_language/test_slot_compiler.rb
Normal file
@ -0,0 +1,15 @@
|
||||
require_relative "helper"
|
||||
|
||||
module SlotLanguage
|
||||
class TestSlotCompiler < MiniTest::Test
|
||||
def test_init
|
||||
assert SlotCompiler.new
|
||||
end
|
||||
def test_compile
|
||||
assert_equal SlotMaker , SlotCompiler.compile("a").class
|
||||
end
|
||||
def test_fail_args
|
||||
assert_raises{ SlotCompiler.compile("a(1)")}
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user