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

Version Path
merb-core-1.1.3 spec10/public/webrat/test_app/gems/gems/erubis-2.6.2/test/test-users-guide.rb
merb-core-1.1.2 spec10/public/webrat/test_app/gems/gems/erubis-2.6.2/test/test-users-guide.rb
merb-core-1.1.1 spec10/public/webrat/test_app/gems/gems/erubis-2.6.2/test/test-users-guide.rb
merb-core-1.1.0 spec10/public/webrat/test_app/gems/gems/erubis-2.6.2/test/test-users-guide.rb
merb-core-1.1.0.rc1 spec10/public/webrat/test_app/gems/gems/erubis-2.6.2/test/test-users-guide.rb
simple-templater-0.0.1.3 vendor/erubis/test/test-users-guide.rb
simple-templater-0.0.1.2 vendor/erubis/test/test-users-guide.rb
simple-templater-0.0.1.1 vendor/erubis/test/test-users-guide.rb
rango-0.0.6 vendor/erubis/test/test-users-guide.rb
rango-0.1.pre vendor/erubis/test/test-users-guide.rb
simple-templater-0.0.1 vendor/erubis/test/test-users-guide.rb
merb-core-1.1.0.pre spec10/public/webrat/test_app/gems/gems/erubis-2.6.2/test/test-users-guide.rb
erubis-2.6.2 test/test-users-guide.rb