Sha256: 23eb32b4f2c47f6552787c1b7b8328609ad9f113ea47dc410ba3283fe203c59f

Contents?: true

Size: 575 Bytes

Versions: 1

Compression:

Stored size: 575 Bytes

Contents

require File.join(File.dirname(__FILE__), '..', '..', 'spec_helper')

include YARD::Parser::Ruby

describe YARD::Parser::Ruby::AstNode, "#jump" do
  it "should jump to the first specific inner node if found" do
    ast = s(:paren, s(:paren, s(:params, s(s(:ident, "hi"), s(:ident, "bye")))))
    ast.jump(:params)[0][0].type.should equal(:ident)
  end
  
  it "should return the original ast if no inner node is found" do
    ast = s(:paren, s(:list, s(:list, s(s(:ident, "hi"), s(:ident, "bye")))))
    ast.jump(:params).object_id.should == ast.object_id
  end
end if RUBY19

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
yard-0.2.3 spec/parser/ruby/ast_node_spec.rb