Sha256: 362e13408e54dc2e9fa1b5490329f23ed32f9036bebf531dba29d97b2d218c70

Contents?: true

Size: 548 Bytes

Versions: 4

Compression:

Stored size: 548 Bytes

Contents

require File.dirname(__FILE__) + '/../../../spec_helper.rb'

context "should_throw" do

  specify "should fail when no symbol is thrown" do
    lambda do
      lambda {}.should_throw(:foo)
    end.should_fail
  end

  specify "should fail when wrong symbol is thrown" do
    lambda do
      lambda do
        throw(:bar)
      end.should_throw(:foo)
    end.should_fail
  end

  specify "should pass when proper symbol is thrown" do
    lambda do
      lambda do
        throw(:foo)
      end.should_throw(:foo)
    end.should_not_raise
  end

end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
riess-0.0.8 vendor/rspec-0.8.2/spec/spec/expectations/should/should_throw_spec.rb
rspec-0.8.0 spec/spec/expectations/should/should_throw_spec.rb
rspec-0.8.1 spec/spec/expectations/should/should_throw_spec.rb
rspec-0.8.2 spec/spec/expectations/should/should_throw_spec.rb