test/test_faq.rb in tenjin-0.6.2 vs test/test_faq.rb in tenjin-0.7.0

- old
+ new

@@ -1,42 +1,42 @@ ### -### $Rev: 45 $ -### $Release: 0.6.2 $ -### copyright(c) 2007-2008 kuwata-lab.com all rights reserved. +### $Rev$ +### $Release: 0.7.0 $ +### copyright(c) 2007-2011 kuwata-lab.com all rights reserved ### -require 'test/unit' -#require 'testutil' -#require 'testcase-helper' -require 'assert-text-equal' +require "#{File.dirname(File.expand_path(__FILE__))}/test_all" -require 'tenjin' -class TenjinFaqTest < Test::Unit::TestCase +class TenjinFaqTest + include Oktest::TestCase DIR = File.expand_path(File.dirname(__FILE__) + '/data/faq') CWD = Dir.pwd() - def setup + def before Dir.chdir DIR end - def teardown + def after Dir.chdir CWD end def _test @name = (caller()[0] =~ /`(.*?)'/) && $1 s = File.read(@filename) s =~ /\A\$ (.*?)\n/ command = $1 expected = $' + if RUBY_VERSION >= '1.9' + expected.gsub!(/(expecting|unexpected) kEND/, '\1 keyword_end') + end result = `#{command}` - assert_text_equal(expected, result) + ok_(result) == expected end Dir.chdir DIR do filenames = [] @@ -55,6 +55,11 @@ eval s end end +end + + +if __FILE__ == $0 + Oktest.run_all() end