File: test_case.rb

package info (click to toggle)
ruby-open4 1.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 184 kB
  • sloc: ruby: 806; makefile: 2
file content (23 lines) | stat: -rw-r--r-- 454 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::Unit::TestCase
    include Open4

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

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

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