Sha256: 9212570c6f5fb8b7c1b62707663aa47407dba7180505b1e788b928cd57537f59

Contents?: true

Size: 1.06 KB

Versions: 19

Compression:

Stored size: 1.06 KB

Contents

require 'rubygems'
require 'test/unit'
require 'fileutils'

dir = File.dirname(File.expand_path(__FILE__))
$LOAD_PATH.unshift(File.join(dir, '..', 'lib'))
$LOAD_PATH.unshift(dir)

require 'gollum-site'

# Make sure we're in the test dir, the tests expect that to be the current
# directory.
TEST_DIR = File.join(File.dirname(__FILE__), *%w[.])

def testpath(path)
  File.join(TEST_DIR, path)
end

# test/spec/mini 3
# http://gist.github.com/25455
# chris@ozmm.org
# file:lib/test/spec/mini.rb
def context(*args, &block)
  return super unless (name = args.first) && block
  require 'test/unit'
  klass = Class.new(defined?(ActiveSupport::TestCase) ? ActiveSupport::TestCase : Test::Unit::TestCase) do
    def self.test(name, &block)
      define_method("test_#{name.gsub(/\W/,'_')}", &block) if block
    end
    def self.xtest(*args) end
    def self.setup(&block) define_method(:setup, &block) end
    def self.teardown(&block) define_method(:teardown, &block) end
  end
  (class << klass; self end).send(:define_method, :name) { name.gsub(/\W/,'_') }
  klass.class_eval &block
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
gollum-site-0.1.12 test/helper.rb
gollum-site-0.1.11 test/helper.rb
gollum-site-0.1.10 test/helper.rb
gollum-site-0.1.9 test/helper.rb
gollum-site-0.1.8 test/helper.rb
gollum-site-0.1.7 test/helper.rb
gollum-site-0.1.6 test/helper.rb
gollum-site-0.1.5 test/helper.rb
gollum-site-0.1.4 test/helper.rb
gollum-site-0.1.3 test/helper.rb
gollum-site-0.1.2 test/helper.rb
gollum-site-0.1.1 test/helper.rb
gollum-site-0.1.0 test/helper.rb
gollum-site-0.0.6 test/helper.rb
gollum-site-0.0.5 test/helper.rb
gollum-site-0.0.4 test/helper.rb
gollum-site-0.0.3 test/helper.rb
gollum-site-0.0.2 test/helper.rb
gollum-site-0.0.1 test/helper.rb