Sha256: 355e86d547bd4bdc8d3bd6b28e14d874467222ae8f62c0e7e5ad152df38d9f29
Contents?: true
Size: 1.02 KB
Versions: 13
Compression:
Stored size: 1.02 KB
Contents
### ### $Rev: 115 $ ### $Release: 2.6.2 $ ### copyright(c) 2006-2008 kuwata-lab.com all rights reserved. ### require "#{File.dirname(__FILE__)}/test.rb" class KwarkUsersGuideTest < Test::Unit::TestCase DIR = File.expand_path(File.dirname(__FILE__) + '/data/users-guide') CWD = Dir.pwd() def setup Dir.chdir DIR end def teardown Dir.chdir CWD end def _test @name = (caller()[0] =~ /`(.*?)'/) && $1 s = File.read(@filename) s =~ /\A\$ (.*?)\n/ command = $1 expected = $' result = `#{command}` assert_text_equal(expected, result) end Dir.chdir DIR do filenames = [] filenames += Dir.glob('*.result') filenames += Dir.glob('*.source') filenames.each do |filename| name = filename.gsub(/[^\w]/, '_') s = <<-END def test_#{name} # $stderr.puts "*** debug: test_#{name}" @name = '#{name}' @filename = '#{filename}' _test() end END eval s end end self.post_definition() end
Version data entries
13 entries across 13 versions & 4 rubygems