-
Notifications
You must be signed in to change notification settings - Fork 438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rwrite test-case for rubygems_hook without Gem::TestCase #815
Conversation
9743b27
to
f8d1087
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suppress outputs from the hook.
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
d5ed014
to
8460a36
Compare
|
||
@hook = RDoc::RubygemsHook.new @a | ||
|
||
begin | ||
RDoc::RubygemsHook.load_rdoc | ||
rescue Gem::DocumentError => e | ||
skip e.message | ||
pend e.message |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an interesting change, would pend
be interchangeable with omit
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I was late to the conversation, sorry about that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what differences pend
and omit
.
@kou Do you have any opinion about them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
omit
is suitable for this case.
omit
for omitting the test because the test isn't needed to be ran.
pend
for omitting the test temporary. The test should be fixed later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally, pend
is used with a block.
If the given block is failed, it's expected for pend
. The test is marked as "pending".
If the given block is not failed, it's unexpected for pend
. The test is marked as "failed".
require "test-unit"
class T < Test::Unit::TestCase
test "pend: pass" do
pend "XXX" do
assert_equal("AAA", "AAA")
end
end
test "pend: failure" do
pend "XXX" do
assert_equal("AAA", "BBB")
end
end
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kou Thanks! I understood them.
These conditions are not temporary, rather platform dependent. ruby#815 (comment)
These conditions are not temporary, rather platform dependent. ruby/rdoc#815 (comment) ruby/rdoc@92545fa250
…83aa8394fc26e341666db66938b1d6fc2cbb8e,f2e39e5fed498b51ae914ed42ec51ae578330583,6aaa1c4d09249baae93d5bb7fba585be420c4fee,923b3652247aa17ac99dc45cb1cd0654fa08d976,950c7a12efa19d73bed10d377368a50664cae32c,69ce9e4187589335124077029496ee293d4e9189,ddb87396349fa4699153d5c4c7569c2e0186adfc,09e7a0c4a4fba18e3308e4f8cb4b8b5b52b41d20,298d65b1e4f3019af7fc9b905390b56736f5fd0e,2f3edf28f3a251bac2cf3b47b46b372faac71e8e: [ruby/rdoc] Follow-up rubygems Use test-unit assertions instead of minitest. ruby/rdoc@d6a6209d7f --- test/rdoc/test_rdoc_rubygems_hook.rb | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) [ruby/rdoc] Add an alias for test-unit with older versions of RubyGems ruby/rdoc@b8d68fdd87 --- test/rdoc/test_rdoc_rubygems_hook.rb | 3 +++ 1 file changed, 3 insertions(+) [ruby/rdoc] Rwrite test-case for rubygems_hook without Gem::TestCase ruby/rdoc@f8d1087ce5 --- test/rdoc/test_rdoc_rubygems_hook.rb | 38 +++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 18 deletions(-) [ruby/rdoc] Update test/rdoc/test_rdoc_rubygems_hook.rb ruby/rdoc@fb264c4cc4 Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org> --- test/rdoc/test_rdoc_rubygems_hook.rb | 4 ++++ 1 file changed, 4 insertions(+) [ruby/rdoc] Use pend instead of skip ruby/rdoc@8460a36d84 --- test/rdoc/test_rdoc_rubygems_hook.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) Close UserInteraction for tests to fix leaked file descriptors --- test/rdoc/test_rdoc_rubygems_hook.rb | 2 ++ 1 file changed, 2 insertions(+) Make temporary directory under the regular location --- test/rdoc/test_rdoc_rubygems_hook.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) Clear default configurations Remove environment variables which can affect the default configurations. --- test/rdoc/test_rdoc_rubygems_hook.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) Clear rdoc options in the global rubygems configuration --- test/rdoc/test_rdoc_rubygems_hook.rb | 2 ++ 1 file changed, 2 insertions(+) Dispose the global rubygems configuration wholely --- test/rdoc/test_rdoc_rubygems_hook.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Discard RDOCOPT environment variable to make tests stable --- test/rdoc/test_rdoc_rubygems_hook.rb | 1 + 1 file changed, 1 insertion(+) [ruby/rdoc] Prefer omit to pend These conditions are not temporary, rather platform dependent. ruby/rdoc#815 (comment) ruby/rdoc@92545fa250 --- test/rdoc/test_rdoc_rubygems_hook.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
No description provided.