class TestGLibSpawn

Public Instance Methods

setup() click to toggle source
# File glib2/test/test_spawn.rb, line 6
def setup
end
teardown() click to toggle source
# File glib2/test/test_spawn.rb, line 9
def teardown
end
test_async_clear_environment() click to toggle source
# File glib2/test/test_spawn.rb, line 20
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
test_async_keep_environment() click to toggle source
# File glib2/test/test_spawn.rb, line 12
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