Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #353 from alexch/fork_docs

DRYer and more self-documenting tests of background rdoc generation
  • Loading branch information...
commit 0d36b2ff804eda3bf144c7e85e029de625f3d449 2 parents 31f87d9 + bd15eef
@zenspider zenspider authored
View
8 lib/rubygems/test_case.rb
@@ -796,6 +796,14 @@ def nmake_found?
system('nmake /? 1>NUL 2>&1')
end
+ # In case we're building docs in a background process, this method waits for
+ # that process to exit (or if it's already been reaped, or never happened,
+ # swallows the Errno::ECHILD error).
+ def wait_for_child_process_to_exit
+ Process.wait if Process.respond_to?(:fork)
+ rescue Errno::ECHILD
+ end
+
##
# Allows tests to use a random (but controlled) port number instead of
# a hardcoded one. This helps CI tools when running parallels builds on
View
2  test/rubygems/test_gem_commands_install_command.rb
@@ -304,7 +304,7 @@ def test_execute_rdoc
assert_equal 0, e.exit_code
end
- Process.wait rescue Errno::ECHILD if Process.respond_to?(:fork)
+ wait_for_child_process_to_exit
assert_path_exists File.join(@a2.doc_dir, 'ri')
assert_path_exists File.join(@a2.doc_dir, 'rdoc')
View
2  test/rubygems/test_gem_commands_update_command.rb
@@ -274,7 +274,7 @@ def test_execute_rdoc
@cmd.execute
end
- Process.wait rescue Errno::ECHILD if Process.respond_to?(:fork)
+ wait_for_child_process_to_exit
assert_path_exists File.join(@a2.doc_dir, 'ri')
assert_path_exists File.join(@a2.doc_dir, 'rdoc')
Please sign in to comment.
Something went wrong with that request. Please try again.