2015-12-16 08:07:31 +03:00
|
|
|
# frozen_string_literal: false
|
2012-07-21 09:12:32 +04:00
|
|
|
require 'test/unit'
|
|
|
|
|
2012-07-25 05:01:59 +04:00
|
|
|
class TestRedefinition < Test::Unit::TestCase
|
|
|
|
def test_redefinition
|
2014-03-11 08:22:34 +04:00
|
|
|
assert_match(/^test\/unit warning: method TestForTestRedefinition#test_redefinition is redefined$/,
|
|
|
|
redefinition)
|
2013-06-19 11:47:26 +04:00
|
|
|
end
|
|
|
|
|
|
|
|
def redefinition(*args)
|
|
|
|
IO.popen([*@options[:ruby], "#{File.dirname(__FILE__)}/test4test_redefinition.rb", *args],
|
|
|
|
err: [:child, :out]) {|f|
|
|
|
|
f.read
|
|
|
|
}
|
2012-07-21 09:12:32 +04:00
|
|
|
end
|
|
|
|
end
|