Sha256: cc52277aabfa10d75610aa4ab0185d2840fd52631bff5c331bf1e5efec727350

Contents?: true

Size: 1008 Bytes

Versions: 3

Compression:

Stored size: 1008 Bytes

Contents

Feature: match unless raises with an unexpected error

  In order to know when a match_unless_raises block raises an unexpected error
  As an RSpec user
  I want the error to bubble up

  Background:
    Given a file named "example.rb" with:
      """
      Spec::Matchers.define :be_the_same_as do |expected|
        match_unless_raises SyntaxError do |actual|
          raise "unexpected error"
        end
      end
      """
  
  Scenario: failing examples
    Given a file named "match_unless_raises_spec.rb" with:
      """
      require './example.rb'

      describe 4 do
        it "is 4" do
          # intentionally fail
          4.should_not be_the_same_as(4)
        end
      end

      describe 5 do
        it "is not 4" do
          # intentionally fail
          5.should be_the_same_as(4)
        end
      end
      """
    When I run "spec match_unless_raises_spec.rb"
    Then the stdout should include "2 examples, 2 failures"
    Then the stdout should include "unexpected error"
  

Version data entries

3 entries across 3 versions & 3 rubygems

Version Path
rspec-instructure-1.3.3 features/matchers/match_unless_raises_unexpected_error.feature
radiant-1.0.0 ruby-debug/ruby/1.8/gems/rspec-1.3.2/features/matchers/match_unless_raises_unexpected_error.feature
rspec-1.3.2 features/matchers/match_unless_raises_unexpected_error.feature