Sha256: fbea45af607a4b16f69ccaf1a2595b515a1c35997fb177fdd8eb426aeedb9b6e

Contents?: true

Size: 874 Bytes

Versions: 1

Compression:

Stored size: 874 Bytes

Contents

dir = File.dirname(File.expand_path(__FILE__))
$LOAD_PATH.unshift dir + '/../lib'

require 'rubygems'
require 'test/unit'
begin
  require 'turn'
rescue LoadError
end
require 'mocha'
require 'copy'

class Test::Unit::TestCase
  def self.test(name, &block)
    define_method("test_#{name.gsub(/\W/,'_')}", &block) if block
  end

  def self.setup(&block)
    define_method(:setup, &block)
  end
  
  def self.teardown(&block)
    define_method(:teardown, &block)
  end
end

module CopyAppSetup
  def app
    Copy::Server
  end
  
  def setup
    app.config do
      set :views, File.dirname(File.expand_path(__FILE__)) + '/test_app/views'
    end
  end
  
  def setup_auth(user, pass)
    app.config do
      set :admin_username, user
      set :admin_password, pass
    end
  end
  
  def authorize!
    setup_auth 'super', 'secret'
    authorize  'super', 'secret'
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
copy-0.0.4 test/test_helper.rb