Sha256: 15e309fd2278dfcad6efe1a3daf95e230f9f795ae3653ba03f3e67cbbd197d38

Contents?: true

Size: 587 Bytes

Versions: 4

Compression:

Stored size: 587 Bytes

Contents

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

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

4 entries across 4 versions & 1 rubygems

Version Path
opal-0.6.3 spec/cli/parser/op_asgn2_spec.rb
opal-0.6.2 spec/cli/parser/op_asgn2_spec.rb
opal-0.6.1 spec/cli/parser/op_asgn2_spec.rb
opal-0.6.0 spec/cli/parser/op_asgn2_spec.rb