Sha256: 970608d34b61d77880805c00a67a4c64b9b019ccd55eef33810f0d74c8ab31c5

Contents?: true

Size: 406 Bytes

Versions: 19

Compression:

Stored size: 406 Bytes

Contents

require 'spec_helper'

describe "begin & rescue blocks" do
  it "should evaluate to begin blocks last expression when no exception" do
    result = begin
      "a"
    rescue
      "b"
    end

    result.should == "a"
  end

  it "should evaluate to rescue blocks last expression when exception" do
    result = begin
      raise "foo"
    rescue
      "bar"
    end

    result.should == "bar"
  end
end

Version data entries

19 entries across 19 versions & 2 rubygems

Version Path
opal-0.9.4 spec/opal/core/language_spec.rb
opal-0.9.3 spec/opal/core/language_spec.rb
opal-0.9.2 spec/opal/core/language_spec.rb
opal-0.9.0 spec/opal/core/language_spec.rb
opal-0.9.0.rc1 spec/opal/core/language_spec.rb
opal-0.9.0.beta2 spec/opal/core/language_spec.rb
opal-0.9.0.beta1 spec/opal/core/language_spec.rb
opal-0.8.1 spec/opal/core/language_spec.rb
opal-0.8.1.rc1 spec/opal/core/language_spec.rb
opal-wedge-0.9.0.dev spec/opal/core/language_spec.rb
opal-0.8.0 spec/opal/core/language_spec.rb
opal-0.8.0.rc3 spec/opal/core/language_spec.rb
opal-0.8.0.rc2 spec/opal/core/language_spec.rb
opal-0.8.0.rc1 spec/opal/core/language_spec.rb
opal-0.8.0.beta1 spec/opal/core/language_spec.rb
opal-0.7.2 spec/opal/core/language_spec.rb
opal-0.7.1 spec/opal/core/language_spec.rb
opal-0.7.0 spec/opal/core/language_spec.rb
opal-0.7.0.rc1 spec/opal/core/language_spec.rb