File: bug_report_830_spec.rb

package info (click to toggle)
ruby-rspec-mocks 2.14.5-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 868 kB
  • ctags: 725
  • sloc: ruby: 8,227; makefile: 4
file content (21 lines) | stat: -rw-r--r-- 418 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
require 'spec_helper'

module RSpec
  module Mocks
    describe 'Calling a method that catches StandardError' do
      class Foo
        def self.foo
          bar
        rescue StandardError
        end
      end

      it 'still reports mock failures' do
        Foo.should_not_receive :bar
        expect {
          Foo.foo
        }.to raise_error(RSpec::Mocks::MockExpectationError)
      end
    end
  end
end