Parent

TestParseTree

Public Instance Methods

setup() click to toggle source
# File test/test_parse_tree.rb, line 253
def setup
  super
  @processor = ParseTree.new(false)
end
test_process_string() click to toggle source
# File test/test_parse_tree.rb, line 258
def test_process_string
  actual   = @processor.process '1 + nil'
  expected = s(:call, s(:lit, 1), :+, s(:arglist, s(:nil)))

  assert_equal expected, actual

  actual   = @processor.process 'puts 42'
  expected = s(:call, nil, :puts, s(:arglist, s(:lit, 42)))

  assert_equal expected, actual
end
test_process_string_newlines() click to toggle source
# File test/test_parse_tree.rb, line 270
def test_process_string_newlines
  @processor = ParseTree.new(true)
  actual   = @processor.process "1 +\n nil", false, 'test.rb', 5
  expected = s(:newline, 6, "test.rb",
               s(:call, s(:lit, 1), :+, s(:arglist, s(:nil))))

  assert_equal expected, actual
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.