Skip to content

Commit

Permalink
Showing 2 changed files with 11 additions and 8 deletions.
1 change: 0 additions & 1 deletion test/mri/excludes/TestRubyOptions.rb
Original file line number Diff line number Diff line change
@@ -30,5 +30,4 @@
exclude :test_unused_variable, "needs investigation"
exclude :test_usage, "expects a specific number of lines in -h output"
exclude :test_usage_long, "needs investigation"
exclude :test_version, "needs investigation"
exclude :test_warning, "needs investigation"
18 changes: 11 additions & 7 deletions test/mri/ruby/test_rubyoptions.rb
Original file line number Diff line number Diff line change
@@ -83,14 +83,18 @@ def test_debug
"", %w(true), [])
end

private def version_match
case RUBY_ENGINE
when 'jruby'
/^jruby #{RUBY_ENGINE_VERSION} \(#{RUBY_VERSION}\).*? \[#{RbConfig::CONFIG["host_os"]}-#{RbConfig::CONFIG["host_cpu"]}\]$/
else
/^ruby #{RUBY_VERSION}(?:[p ]|dev|rc).*? \[#{RUBY_PLATFORM}\]$/
end
end

def test_verbose
assert_in_out_err(["-vve", ""]) do |r, e|
case RUBY_ENGINE
when 'ruby'
assert_match(/^ruby #{RUBY_VERSION}(?:[p ]|dev|rc).*? \[#{RUBY_PLATFORM}\]$/, r[0])
when 'jruby'
assert_match(/^jruby #{RUBY_ENGINE_VERSION} \(#{RUBY_VERSION}\).*? \[#{RbConfig::CONFIG["host_os"]}-#{RbConfig::CONFIG["host_cpu"]}\]$/, r[0])
end
assert_match(version_match, r[0])
assert_equal(RUBY_DESCRIPTION, r[0])
assert_equal([], e)
end
@@ -144,7 +148,7 @@ def test_kanji

def test_version
assert_in_out_err(%w(--version)) do |r, e|
assert_match(/^ruby #{RUBY_VERSION}(?:[p ]|dev|rc).*? \[#{RUBY_PLATFORM}\]$/, r[0])
assert_match(version_match, r[0])
assert_equal(RUBY_DESCRIPTION, r[0])
assert_equal([], e)
end

0 comments on commit 5837373

Please sign in to comment.