1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* test/ruby/test_rubyoptions.rb: make version matching support

JRuby's version output.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
headius 2016-03-14 16:24:04 +00:00
parent 3d5a3a236d
commit a4e97af645
2 changed files with 16 additions and 2 deletions

View file

@ -1,3 +1,8 @@
Tue Mar 15 01:22:27 2016 Charles Oliver Nutter <headius@headius.com>
* test/ruby/test_rubyoptions.rb: make version matching support
JRuby's version output.
Mon Mar 14 19:05:39 2016 NARUSE, Yui <naruse@ruby-lang.org>
* bignum.c (big2str_2bdigits): reduce div instruction.

View file

@ -84,9 +84,18 @@ class TestRubyOptions < Test::Unit::TestCase
"", %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|
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
@ -140,7 +149,7 @@ class TestRubyOptions < Test::Unit::TestCase
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