test/support.rb in ruby-graphviz-0.9.19 vs test/support.rb in ruby-graphviz-0.9.20

- old
+ new

@@ -1,10 +1,14 @@ require 'rubygems' require 'test/unit' +begin require 'ruby-debug' +rescue LoadError +end +require 'stringio' -root = File.expand_path('../..',__FILE__) +root = File.expand_path('../../lib',__FILE__) $:.unshift(root) unless $:.include?(root) require 'graphviz' # hack so that the example scripts don't unnecessarily unshift @todo @@ -17,11 +21,11 @@ module TestSupport extend self # @todo move to app? def windows? - /Windows/ =~ ENV['OS'] + /mswin|mingw/ =~ RUBY_PLATFORM end def dev_null windows? ? 'NUL' : '/dev/null' end @@ -49,9 +53,10 @@ # which for me was failing silently when i forgot to make the appropriate # ones public. hack! # except = %w(inspect kind_of?) + except += except.map{|x| x.to_sym } # for Ruby 1.9 these = ancestors[0].instance_methods # these = [1,2,3].map{|x| ancestors[x].instance_methods(false)}.flatten eraseme = (these - except) eraseme.each{ |name| protected name } attr_reader :io