require_relative "helper" class TestBasic < MiniTest::Test # include the magic (setup and parse -> test method translation), see there include ParserHelper def test_expression_else @string_input = <[{:integer=>"4"}, {:integer=>"5"}]} @transform_output = {:expressions=>[ Parser::IntegerExpression.new(4), Parser::IntegerExpression.new(5)]} @parser = @parser.expressions_else end def test_expression_end @string_input = < [ { :integer => "5" }, { :name => "name" }, { :function_call => { :name => "call" } , :argument_list => [ {:argument => { :integer => "4" } } , {:argument => { :integer => "6" } } ] } ]} args = [ Parser::IntegerExpression.new(4) , Parser::IntegerExpression.new(6) ] @transform_output = {:expressions=>[ Parser::IntegerExpression.new(5), Parser::NameExpression.new("name") , Parser::FuncallExpression.new("call", args ) ] } @parser = @parser.expressions_end end end