2009-05-26 14:17:55-04:00

require 'test/unit'

# The following tests capture issues that either are blocking progress,
# require workarounds, or otherwise are felt that it would be better if
# the issue were resolved before the next development release of Ruby 1.9.0.
#
# Each of the following tests for the PRESENCE of the issue.  What that
# means is that if the test fails, there is work to be done, either
# to resume exploring tests that were previously blocked, or to remove
# a workaround, or, at a minimum, to remove the issue from this list.
#
# Other things worth watching:
#   builder
#     http://intertwingly.net/blog/2008/01/04/Builder-on-1-9
#     http://intertwingly.net/projects/ruby19/patches/builder.patch
#   html5lib
#     http://html5lib.googlecode.com/svn/trunk/ruby/test19.rb
#   libxml2
#     http://rubyforge.org/pipermail/libxml-devel/2008-January/000683.html
#     http://rubyforge.org/tracker/index.php?func=detail&aid=17666&group_id=494&atid=1973
#   rake
#     http://intertwingly.net/blog/2008/01/07/Rake-Contrib-for-1-9
#     http://intertwingly.net/projects/ruby19/patches/rake-contrib.gemspec
#   xmpp4r
#     http://svn.gna.org/svn/xmpp4r/trunk/xmpp4r/test/ts_xmpp4r.rb
#
###########################################################################
# The following tests capture issues that are blocking further progress

class Blockers < Test::Unit::TestCase

  require 'delegate'
  class C < SimpleDelegator; end

  # Blocks html5lib/test/test_sanitizer
  # http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/15160
  # http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/15223
  # http://rubyforge.org/tracker/index.php?func=detail&aid=17700&group_id=426&atid=1698
  def test_delegates_too_much
    # With Ruby 1.8.6, the following would produce "C"
    assert_equal String, C.new('').class
  end

  def disabled_test_stdout_clobbers_file_mode
    # Blocks test/spec
    # http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/15360
    # http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/15361
    # http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/15362
    # http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/15364
    # http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/15406
    # http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/15410
    # http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=15396
    # http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/15415
    # http://rubyforge.org/tracker/?func=detail&atid=1698&aid=17920&group_id=426
    # http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=15473
    require 'tmpdir'
    old_stdout = STDOUT.dup
    STDOUT.reopen File.open(File.join(Dir.tmpdir, "capture_#{$$}"), "w+")    
    puts 'hi'
    out = STDOUT.dup
    STDOUT.reopen old_stdout
    out.rewind
    output = out.read
    assert_no_match /hi/, output
  rescue IOError
    assert_match /not opened for reading/, $!.message
  ensure
    out.close
    require 'fileutils'
    FileUtils.rm_f out.path
  end
end

sh: /home/rubys/build/ruby19/bin/ruby: not found