Sha256: 5d9098b9e12461ce8199e9c571bc4964a2b0c3daee43f02892b60e405f6d7ae5

Contents?: true

Size: 388 Bytes

Versions: 26

Compression:

Stored size: 388 Bytes

Contents

require 'spec_helper'

describe "Constants" do
  it "should always become a s(:const)" do
    opal_parse("FOO").should == [:const, :FOO]
    opal_parse("BAR").should == [:const, :BAR]
  end

  it "should be returned as s(:cdecl) on assignment" do
    opal_parse("FOO = 1").should == [:cdecl, :FOO, [:lit, 1]]
    opal_parse("FOO = BAR").should == [:cdecl, :FOO, [:const, :BAR]]
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
opal-0.4.3 spec/parser/const_spec.rb
opal-0.4.2 spec/parser/const_spec.rb
opal-0.4.1 spec/parser/const_spec.rb
opal-0.4.0 spec/parser/const_spec.rb
opal-0.3.44 spec/parser/const_spec.rb
opal-0.3.43 spec/parser/const_spec.rb
opal-0.3.42 spec/grammar/const_spec.rb
opal-0.3.41 spec/grammar/const_spec.rb
opal-0.3.40 spec/grammar/const_spec.rb
opal-0.3.39 spec/grammar/const_spec.rb
opal-0.3.38 spec/grammar/const_spec.rb
opal-0.3.37 spec/grammar/const_spec.rb
opal-0.3.36 spec/grammar/const_spec.rb
opal-0.3.35 spec/grammar/const_spec.rb
opal-0.3.34 spec/grammar/const_spec.rb
opal-0.3.33 spec/grammar/const_spec.rb
opal-0.3.32 spec/grammar/const_spec.rb
opal-0.3.31 spec/grammar/const_spec.rb
opal-0.3.30 spec/grammar/const_spec.rb
opal-0.3.29 spec/grammar/const_spec.rb