зеркало из https://github.com/github/ruby.git
[rubygems/rubygems] Extract assert_output to assert_empty and assert_equal with capture_output
https://github.com/rubygems/rubygems/commit/f6759440a4
This commit is contained in:
Родитель
183174475c
Коммит
81d793a921
|
@ -1966,9 +1966,11 @@ You may need to `gem install -g` to install missing gems
|
|||
EXPECTED
|
||||
|
||||
Gem::Deprecate.skip_during do
|
||||
assert_output nil, expected do
|
||||
actual_stdout, actual_stderr = capture_output do
|
||||
Gem.use_gemdeps
|
||||
end
|
||||
assert_empty actual_stdout
|
||||
assert_equal(expected, actual_stderr)
|
||||
end
|
||||
ensure
|
||||
ENV['RUBYGEMS_GEMDEPS'] = rubygems_gemdeps
|
||||
|
|
|
@ -87,9 +87,10 @@ Gems to install:
|
|||
a-2
|
||||
EXPECTED
|
||||
|
||||
assert_output expected do
|
||||
actual, _= capture_output do
|
||||
rs.install_from_gemdeps :gemdeps => io.path, :explain => true
|
||||
end
|
||||
assert_equal(expected, actual)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -3021,9 +3021,11 @@ WARN: Clearing out unresolved specs. Try 'gem cleanup <gem>'
|
|||
Please report a bug if this causes problems.
|
||||
EXPECTED
|
||||
|
||||
assert_output nil, expected do
|
||||
actual_stdout, actual_stderr = capture_output do
|
||||
specification.reset
|
||||
end
|
||||
assert_empty actual_stdout
|
||||
assert_equal(expected, actual_stderr)
|
||||
end
|
||||
|
||||
def test_unresolved_specs_with_versions
|
||||
|
@ -3052,9 +3054,11 @@ WARN: Clearing out unresolved specs. Try 'gem cleanup <gem>'
|
|||
Please report a bug if this causes problems.
|
||||
EXPECTED
|
||||
|
||||
assert_output nil, expected do
|
||||
actual_stdout, actual_stderr = capture_output do
|
||||
specification.reset
|
||||
end
|
||||
assert_empty actual_stdout
|
||||
assert_equal(expected, actual_stderr)
|
||||
end
|
||||
|
||||
def test_duplicate_runtime_dependency
|
||||
|
|
|
@ -47,9 +47,11 @@ class TestGemVersion < Gem::TestCase
|
|||
assert_equal false, Gem::Version.correct?("an incorrect version")
|
||||
|
||||
expected = "nil versions are discouraged and will be deprecated in Rubygems 4\n"
|
||||
assert_output nil, expected do
|
||||
actual_stdout, actual_stderr = capture_output do
|
||||
Gem::Version.correct?(nil)
|
||||
end
|
||||
assert_empty actual_stdout
|
||||
assert_equal(expected, actual_stderr)
|
||||
end
|
||||
|
||||
def test_class_new_subclass
|
||||
|
|
Загрузка…
Ссылка в новой задаче