Sha256: 11b53adc862f45bcea0632f6a674e5362ed6ca9727da5b31c4c98163ce599f12
Contents?: true
Size: 1.24 KB
Versions: 2
Compression:
Stored size: 1.24 KB
Contents
require File.dirname(__FILE__) + '/../../spec_helper' describe Melbourne::Parser do it 'should correctly parse "@@x"' do ruby = '@@x' ast = {:classvariableaccess=>{:@name=>:@@x, :@line=>1}} ruby.should parse_as(ast) end it 'should correctly parse "class A; @@a; end"' do ruby = <<-ruby class A @@a end ruby ast = {:class=> {:@superclass=>{}, :@body=> {:classscope=> {:@body=> {:block=> {:@array=>[{:classvariableaccess=>{:@name=>:@@a, :@line=>2}}], :@line=>3}}, :@name=>:A, :@line=>1}}, :@name=>{:classname=>{:@superclass=>{}, :@name=>:A, :@line=>1}}, :@line=>1}} ruby.should parse_as(ast) end it 'should correctly parse "module M; @@a; end"' do ruby = <<-ruby module M @@a end ruby ast = {:module=> {:@body=> {:modulescope=> {:@body=> {:block=> {:@array=>[{:classvariableaccess=>{:@name=>:@@a, :@line=>2}}], :@line=>3}}, :@name=>:M, :@line=>1}}, :@name=>{:modulename=>{:@name=>:M, :@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/cvar_spec.rb |
melbourne-1.0.0 | spec/lib/parser/cvar_spec.rb |