Skip to content

Commit

Permalink
make sure we're using ::Process.spawn and not POSIX::Process.spawn
Browse files Browse the repository at this point in the history
  • Loading branch information
rtomayko committed Mar 3, 2011
1 parent 1e26945 commit 52c2548
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/posix/spawn.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def spawn(*argv)
if respond_to?(:_pspawn)
pspawn(*argv)
elsif ::Process.respond_to?(:spawn)
Process::spawn(*argv)
::Process::spawn(*argv)
else
fspawn(*argv)
end
Expand Down
4 changes: 4 additions & 0 deletions test/test_process.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
class ProcessTest < Test::Unit::TestCase
include POSIX::Spawn

def test_sanity
assert_same POSIX::Spawn::Process, Process
end

def test_argv_array_execs
p = Process.new(['printf', '%s %s %s', '1', '2', '3 4'])
assert p.success?
Expand Down
4 changes: 2 additions & 2 deletions test/test_spawn.rb
Original file line number Diff line number Diff line change
Expand Up @@ -314,11 +314,11 @@ def _spawn(*argv)
end
end

if Process::respond_to?(:spawn)
if ::Process::respond_to?(:spawn)
class NativeSpawnTest < Test::Unit::TestCase
include SpawnImplementationTests
def _spawn(*argv)
Process.spawn(*argv)
::Process.spawn(*argv)
end
end
end

0 comments on commit 52c2548

Please sign in to comment.