mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Simplify conditions for CoreAssertion initialization
This commit is contained in:
parent
940a19e4b3
commit
544e37f184
2 changed files with 6 additions and 5 deletions
|
@ -24,13 +24,11 @@ module Test
|
||||||
end
|
end
|
||||||
|
|
||||||
module CoreAssertions
|
module CoreAssertions
|
||||||
|
require_relative 'envutil'
|
||||||
|
|
||||||
if defined?(MiniTest)
|
if defined?(MiniTest)
|
||||||
require_relative 'envutil'
|
|
||||||
# for ruby core testing
|
# for ruby core testing
|
||||||
include MiniTest::Assertions
|
include MiniTest::Assertions
|
||||||
|
|
||||||
# Compatibility hack for assert_raise
|
|
||||||
Test::Unit::AssertionFailedError = MiniTest::Assertion
|
|
||||||
else
|
else
|
||||||
module MiniTest
|
module MiniTest
|
||||||
class Assertion < Exception; end
|
class Assertion < Exception; end
|
||||||
|
@ -38,7 +36,6 @@ module Test
|
||||||
end
|
end
|
||||||
|
|
||||||
require 'pp'
|
require 'pp'
|
||||||
require_relative 'envutil'
|
|
||||||
include Test::Unit::Assertions
|
include Test::Unit::Assertions
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -303,5 +303,9 @@ EOT
|
||||||
template.gsub(/\G((?:[^\\]|\\.)*?)(\\)?\?/) { $1 + ($2 ? "?" : mu_pp(arguments.shift)) }
|
template.gsub(/\G((?:[^\\]|\\.)*?)(\\)?\?/) { $1 + ($2 ? "?" : mu_pp(arguments.shift)) }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Compatibility hack for assert_raise
|
||||||
|
AssertionFailedError = MiniTest::Assertion
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue