Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

DRYer and more self-documenting tests of background rdoc generation #353

Merged
merged 1 commit into from

3 participants

Alex Chaffee Don't Add Me To Your Organization a.k.a The Travis Bot Ryan Davis
Alex Chaffee

following up on @bhenderson's comments on #352

Don't Add Me To Your Organization a.k.a The Travis Bot

This pull request passes (merged bd15eef into 31f87d9).

Ryan Davis zenspider merged commit 0d36b2f into from
Ryan Davis
Owner

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 7, 2012
  1. Alex Chaffee

    extract wait_for_child_process_to_exit for DRYer and more self-docume…

    alexch authored
    …nting tests of background rdoc generation
This page is out of date. Refresh to see the latest.
8 lib/rubygems/test_case.rb
View
@@ -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
2  test/rubygems/test_gem_commands_install_command.rb
View
@@ -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')
2  test/rubygems/test_gem_commands_update_command.rb
View
@@ -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')
Something went wrong with that request. Please try again.