diff options
author | Alan Wu <XrXr@users.noreply.github.com> | 2021-10-25 20:28:21 -0400 |
---|---|---|
committer | Alan Wu <XrXr@users.noreply.github.com> | 2021-10-27 13:00:05 -0400 |
commit | 6875d6d1fa086fcec58c9d888cbacc1e108a0935 (patch) | |
tree | 1dfa2f3ebccd41c344073d7c1ae9359c2316384c | |
parent | 0d9913e52f3cf3014f2e7a9d9276440a9cd396ea (diff) |
Expect multi-line -v output for -DRUBY_DEVEL in tests
On -DRUBY_DEVEL builds, `ruby -v` can print extra info about the last
commit on a separate line, breaking some tests that expect a single
line. Assert only the first line instead.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/5022
-rw-r--r-- | test/ruby/test_yjit.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/test/ruby/test_yjit.rb b/test/ruby/test_yjit.rb index 691f50a7c1..218d68ea4b 100644 --- a/test/ruby/test_yjit.rb +++ b/test/ruby/test_yjit.rb @@ -23,7 +23,7 @@ class TestYJIT < Test::Unit::TestCase %w(--version --disable=yjit --enable=yjit), ].each do |version_args| assert_in_out_err(version_args) do |stdout, stderr| - assert_equal([RUBY_DESCRIPTION], stdout) + assert_equal(RUBY_DESCRIPTION, stdout.first) assert_equal([], stderr) end end @@ -39,7 +39,10 @@ class TestYJIT < Test::Unit::TestCase def test_enable_from_env_var yjit_child_env = {'RUBY_YJIT_ENABLE' => '1'} - assert_in_out_err([yjit_child_env, '--version'], '', [RUBY_DESCRIPTION]) + assert_in_out_err([yjit_child_env, '--version'], '') do |stdout, stderr| + assert_equal(RUBY_DESCRIPTION, stdout.first) + assert_equal([], stderr) + end assert_in_out_err([yjit_child_env, '-e puts RUBY_DESCRIPTION'], '', [RUBY_DESCRIPTION]) assert_in_out_err([yjit_child_env, '-e p YJIT.enabled?'], '', ['true']) end |