Sha256: ff2ad0c6d0fcf1f7b0d66b37ac90ecd1c59079a9a0cfa514c9890c5e0aaed397

Contents?: true

Size: 486 Bytes

Versions: 2

Compression:

Stored size: 486 Bytes

Contents

require File.dirname(__FILE__) + '/../../spec_helper'

describe Melbourne::Parser do

  it 'should correctly parse "[$&, $`, $\', $+]"' do
    ruby = <<-ruby
        [$&, $`, $', $+]
      ruby
    ast  = {:arrayliteral=>
      {:@body=>
        [{:backref=>{:@kind=>:&, :@line=>1}},
         {:backref=>{:@kind=>:`, :@line=>1}},
         {:backref=>{:@kind=>:"'", :@line=>1}},
         {:backref=>{:@kind=>:+, :@line=>1}}],
       :@line=>1}}

    ruby.should parse_as(ast)
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
melbourne-1.0.1 spec/lib/parser/back_ref_spec.rb
melbourne-1.0.0 spec/lib/parser/back_ref_spec.rb