File: redirect_error.rb

package info (click to toggle)
ruby-flexmock 3.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 836 kB
  • sloc: ruby: 7,572; makefile: 6
file content (16 lines) | stat: -rw-r--r-- 273 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
require 'stringio'

class FlexMock
  module RedirectError
    def redirect_error
      require 'stringio'
      old_err = $stderr
      $stderr = StringIO.new
      yield
      $stderr.string
    ensure
      $stderr = old_err
    end
    private :redirect_error
  end
end