Sha256: 2930d9e541b593a956a213757b06d7676bee7870bb6c086eba981b600ed0b151

Contents?: true

Size: 618 Bytes

Versions: 4

Compression:

Stored size: 618 Bytes

Contents

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

describe "The break keyword" do
  it "should return s(:break) when given no args" do
    parsed("break").should == [:break]
  end

  it "returns s(:break) with a single arg not wrapped in s(:array)" do
    parsed("break 1").should == [:break, [:int, 1]]
    parsed("break *1").should == [:break, [:splat, [:int, 1]]]
  end

  it "returns s(:break) with an s(:array) for args size > 1" do
    parsed("break 1, 2").should == [:break, [:array, [:int, 1], [:int, 2]]]
    parsed("break 1, *2").should == [:break, [:array, [:int, 1], [:splat, [:int, 2]]]]
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

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