Sha256: 48df616e06fcd9f9c15cf98ad552da635c85dede06b404abcbd7b088147747c7

Contents?: true

Size: 564 Bytes

Versions: 39

Compression:

Stored size: 564 Bytes

Contents

require 'support/parser_helpers'

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

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

  it "appends '=' onto the identifier in the sexp" do
    parsed("self.foo += 1")[2].should == :foo=
  end

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

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

Version data entries

39 entries across 39 versions & 3 rubygems

Version Path
opal-0.10.6 spec/lib/parser/op_asgn2_spec.rb
opal-0.10.6.beta spec/lib/parser/op_asgn2_spec.rb
opal-0.10.5 spec/lib/parser/op_asgn2_spec.rb
opal-0.10.4 spec/lib/parser/op_asgn2_spec.rb
opal-0.10.3 spec/lib/parser/op_asgn2_spec.rb
opal-0.10.2 spec/lib/parser/op_asgn2_spec.rb
opal-0.10.1 spec/lib/parser/op_asgn2_spec.rb
opal-0.10.0 spec/lib/parser/op_asgn2_spec.rb
opal-0.10.0.rc2 spec/lib/parser/op_asgn2_spec.rb
opal-0.9.4 spec/lib/parser/op_asgn2_spec.rb
opal-0.9.3 spec/lib/parser/op_asgn2_spec.rb
opal-0.10.0.rc1 spec/lib/parser/op_asgn2_spec.rb
opal-0.10.0.beta5 spec/lib/parser/op_asgn2_spec.rb
opal-0.10.0.beta4 spec/lib/parser/op_asgn2_spec.rb
opal-0.10.0.beta3 spec/lib/parser/op_asgn2_spec.rb
opal-0.10.0.beta2 spec/lib/parser/op_asgn2_spec.rb
opal-0.10.0.beta1 spec/lib/parser/op_asgn2_spec.rb
opal-0.9.2 spec/lib/parser/op_asgn2_spec.rb
opal-0.9.0 spec/lib/parser/op_asgn2_spec.rb
opal-0.9.0.rc1 spec/lib/parser/op_asgn2_spec.rb