Sha256: 7525c31e3699e09bcce89d063a49d5e7b61e6a1189cb3118b96fbb5b3eedf1b5

Contents?: true

Size: 999 Bytes

Versions: 2

Compression:

Stored size: 999 Bytes

Contents

#! /usr/bin/env ruby
require File.dirname(__FILE__) + '/test_helper.rb'
require '_external_tools.rb'
require 'gonzui/webapp'
require '_test-util'

class TextBeautifierTest < Test::Unit::TestCase
  include TestUtil

  def setup
	@dbm = nil
  end
  def teardown
    unless @dbm.nil?
      @dbm.close rescue nil
    end
    @dbm = nil
  end

  def init_dbm(config)
    remove_db(config)
    make_archives
    add_package(config)
    dbm = Gonzui::DBM.open(config)
    @dbm = dbm
    return dbm
  end

  def test_beautify
    config = Gonzui::Config.new
    dbm = init_dbm(config)
    path_id = dbm.get_path_id("foo-0.1/foo.c")
    assert(path_id.is_a?(Fixnum))
    content = dbm.get_content(path_id)
    digest  = dbm.get_digest(path_id)
    beautifier = Gonzui::TextBeautifier.new(content, digest, [], "search?q=")
    html = beautifier.beautify
    assert(html.is_a?(Array))
    assert(html.flatten.include?(:span))
    remove_db(config)
  end
end if (ARC_)

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gonzui-1.2-x86-mswin32-60 test/test_webapp-markup.rb
gonzui-1.2 test/test_webapp-markup.rb