Sha256: 8c9777e47debf2f6ae12df4de3cb2525bc838a25374931839097babfc536b3e8

Contents?: true

Size: 600 Bytes

Versions: 26

Compression:

Stored size: 600 Bytes

Contents

require 'spec_helper'

describe "op_asgn1" do
  it "returns s(:op_asgn1)" do
    opal_parse('self[:foo] += 1')[0].should == :op_asgn1
  end

  it "correctly assigns the receiver" do
    opal_parse("self[:foo] += 1")[1].should == [:self]
  end

  it "returns an arglist for args inside braces" do
    opal_parse("self[:foo] += 1")[2].should == [:arglist, [:lit, :foo]]
  end

  it "only uses the operator, not with '=' appended" do
    opal_parse("self[:foo] += 1")[3].should == :+
  end

  it "uses a simple sexp, not an arglist" do
    opal_parse("self[:foo] += 1")[4].should == [:lit, 1]
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

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