Skip to content

Commit

Permalink
Minor changes to align with MRI master.
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Nov 14, 2016
1 parent 4fcf792 commit fe45447
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions test/mri/ruby/test_rubyoptions.rb
Expand Up @@ -83,18 +83,20 @@ def test_debug
"", %w(true), [])
end

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

def test_verbose
assert_in_out_err(["-vve", ""]) do |r, e|
assert_match(version_match, r[0])
assert_match(VERSION_PATTERN, r[0])
assert_equal(RUBY_DESCRIPTION, r[0])
assert_equal([], e)
end
Expand Down Expand Up @@ -148,7 +150,7 @@ def test_kanji

def test_version
assert_in_out_err(%w(--version)) do |r, e|
assert_match(version_match, r[0])
assert_match(VERSION_PATTERN, r[0])
assert_equal(RUBY_DESCRIPTION, r[0])
assert_equal([], e)
end
Expand Down
2 changes: 1 addition & 1 deletion test/mri/ruby/test_thread.rb
Expand Up @@ -1052,8 +1052,8 @@ def initialize

def test_thread_name
t = Thread.start {sleep}
sleep 0.001 until t.stop?
assert_nil t.name
Thread.pass until t.stop?
s = t.inspect
t.name = 'foo'
assert_equal 'foo', t.name
Expand Down

0 comments on commit fe45447

Please sign in to comment.