Sha256: 8b404da9d1e5b166258da5af6ac0746ee2a650b47c604e0774b8c43afc931fd8

Contents?: true

Size: 410 Bytes

Versions: 6

Compression:

Stored size: 410 Bytes

Contents

require File.expand_path('../../spec_helper', __FILE__)

describe "Global variables" do
  it "should be returned as s(:gvar)" do
    opal_parse("$foo").should == [:gvar, :$foo]
    opal_parse("$:").should == [:gvar, :$:]
  end

  it "should return s(:gasgn) on assignment" do
    opal_parse("$foo = 1").should == [:gasgn, :$foo, [:lit, 1]]
    opal_parse("$: = 1").should == [:gasgn, :$:, [:lit, 1]]
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
opal-0.3.20 spec/grammar/gvar_spec.rb
opal-0.3.19 spec/grammar/gvar_spec.rb
opal-0.3.18 spec/grammar/gvar_spec.rb
opal-0.3.17 test/grammar/gvar_spec.rb
opal-0.3.16 spec/grammar/gvar_spec.rb
opal-0.3.15 spec/grammar/gvar_spec.rb