summaryrefslogtreecommitdiff
path: root/jni/ruby/test/testunit/test_redefinition.rb
blob: ed11621351474ff4ca3e13bfa2c29c46aca08665 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
require 'test/unit'

class TestRedefinition < Test::Unit::TestCase
  def test_redefinition
    assert_match(/^test\/unit warning: method TestForTestRedefinition#test_redefinition is redefined$/,
                 redefinition)
  end

  def redefinition(*args)
    IO.popen([*@options[:ruby], "#{File.dirname(__FILE__)}/test4test_redefinition.rb", *args],
                      err: [:child, :out]) {|f|
      f.read
    }
  end
end