Sha256: ab1662695bdb1b5966354a87428f5d1c7ee0a81701980085ca64854c398bab65

Contents?: true

Size: 805 Bytes

Versions: 75

Compression:

Stored size: 805 Bytes

Contents

# -*- coding: utf-8 -*-
require 'rbconfig'

class TestGLibSpawn < Test::Unit::TestCase
  include GLibTestUtils

  def setup
  end

  def teardown
  end

  def test_async_keep_environment
    if File.exist?('/bin/true')
      assert_nothing_raised do
        GLib::Spawn.async(Dir.pwd, ['/bin/true'], nil, 0)
      end
    end
  end

  def test_async_clear_environment
    if RbConfig.respond_to?(:ruby)
      ruby = RbConfig.ruby
    else
      ruby = File.join(RbConfig::CONFIG['bindir'],
                       RbConfig::CONFIG['RUBY_INSTALL_NAME'] +
                         RbConfig::CONFIG['EXEEXT'])
    end
    pid = GLib::Spawn.async(Dir.pwd, [ruby, '-e', 'exit 1 unless ENV.empty?'], [], GLib::Spawn::DO_NOT_REAP_CHILD)
    _, status = *Process.waitpid2(pid)
    assert status.success?
  end
end

Version data entries

75 entries across 75 versions & 1 rubygems

Version Path
glib2-2.2.4-x64-mingw32 test/test_spawn.rb
glib2-2.2.4-x86-mingw32 test/test_spawn.rb
glib2-2.2.4 test/test_spawn.rb
glib2-2.2.3-x86-mingw32 test/test_spawn.rb
glib2-2.2.3 test/test_spawn.rb
glib2-2.2.2 test/test_spawn.rb
glib2-2.2.2-x86-mingw32 test/test_spawn.rb
glib2-2.2.1-x86-mingw32 test/test_spawn.rb
glib2-2.2.1 test/test_spawn.rb
glib2-2.2.0-x86-mingw32 test/test_spawn.rb
glib2-2.2.0 test/test_spawn.rb
glib2-2.1.0-x86-mingw32 test/test_spawn.rb
glib2-2.1.0 test/test_spawn.rb
glib2-2.0.3-x86-mingw32 test/test_spawn.rb
glib2-2.0.3 test/test_spawn.rb
glib2-2.0.2-x86-mingw32 test/test_spawn.rb
glib2-2.0.2 test/test_spawn.rb
glib2-2.0.1-x86-mingw32 test/test_spawn.rb
glib2-2.0.1 test/test_spawn.rb
glib2-2.0.0-x86-mingw32 test/test_spawn.rb