Sha256: 13786ef1fbbd7a543e775627eb7a4bf1f461a6dd76d3d2d5dd06ce02154f9b4f

Contents?: true

Size: 779 Bytes

Versions: 2

Compression:

Stored size: 779 Bytes

Contents

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

describe Melbourne::Parser do

  it 'should correctly parse "END { 1 }"' do
    ruby = 'END { 1 }'
    ast  = {:send=>
      {:@block=>
        {:iter=>
          {:@body=>{:fixnumliteral=>{:@line=>1, :@value=>1}},
           :@line=>1,
           :@arguments=>
            {:iterarguments=>
              {:@block=>nil,
               :@arity=>-1,
               :@prelude=>nil,
               :@optional=>0,
               :@splat=>nil,
               :@line=>1,
               :@splat_index=>-2,
               :@required_args=>0}}}},
       :@name=>:at_exit,
       :@line=>1,
       :@privately=>true,
       :@receiver=>{:self=>{:@line=>1}},
       :@check_for_local=>false}}

    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/postexe_spec.rb
melbourne-1.0.0 spec/lib/parser/postexe_spec.rb