Sha256: 0eda4224e5dc26705dd52ab7e040625ac19e1df6ffa9791e03f94809002e175a

Contents?: true

Size: 786 Bytes

Versions: 4

Compression:

Stored size: 786 Bytes

Contents

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

context "should_not_throw" do
  specify "should fail when expected symbol is actually thrown" do
    lambda do
      lambda do
        throw(:foo)
      end.should_not_throw(:foo)
    end.should_fail
  end

  specify "should pass when expected symbol is thrown" do
    lambda do
      lambda do
        throw(:bar)
      end.should_not_throw(:foo)
    end.should_not_raise
  end

  specify "should pass when no symbol is thrown" do
    lambda do
      lambda do
        "".to_s
      end.should_not_throw(:foo)
    end.should_not_raise
  end

  specify "should pass when no symbol is thrown and none is specified" do
    lambda do
      lambda do
        "".to_s
      end.should_not_throw
    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_not_throw_spec.rb
rspec-0.8.0 spec/spec/expectations/should/should_not_throw_spec.rb
rspec-0.8.1 spec/spec/expectations/should/should_not_throw_spec.rb
rspec-0.8.2 spec/spec/expectations/should/should_not_throw_spec.rb