2015-12-16 00:07:31 -05:00
|
|
|
# frozen_string_literal: false
|
2012-07-21 01:12:32 -04:00
|
|
|
require 'test/unit'
|
|
|
|
|
2012-07-24 21:01:59 -04:00
|
|
|
class TestRedefinition < Test::Unit::TestCase
|
|
|
|
def test_redefinition
|
2014-03-11 00:22:34 -04:00
|
|
|
assert_match(/^test\/unit warning: method TestForTestRedefinition#test_redefinition is redefined$/,
|
|
|
|
redefinition)
|
2013-06-19 03: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 01:12:32 -04:00
|
|
|
end
|
|
|
|
end
|