File: test_case.rb

package info (click to toggle)
ruby-open4 1.3.4-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 256 kB
  • sloc: ruby: 816; makefile: 4
file content (23 lines) | stat: -rw-r--r-- 446 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# coding: utf-8

require 'minitest/autorun'
require 'open4'
require 'rbconfig'

module Open4
  class TestCase < Minitest::Test
    include Open4

    # Custom exception class for tests so we don't shadow possible
    # programming errors.
    class MyError < RuntimeError; end

    def on_mri?
      ::RbConfig::CONFIG['ruby_install_name'] == 'ruby'
    end

    def wait_status(cid)
      Process.waitpid2(cid).last.exitstatus
    end
  end
end