Skip to content

Commit

Permalink
remove stuff from test_helper
Browse files Browse the repository at this point in the history
  • Loading branch information
Sven Fuchs committed Aug 5, 2010
1 parent 6425f89 commit d4da96c
Showing 1 changed file with 3 additions and 35 deletions.
38 changes: 3 additions & 35 deletions test/test_helper.rb
@@ -1,47 +1,15 @@
$: << File.expand_path('../../lib', __FILE__)
$:.unshift File.expand_path('../../lib', __FILE__)

require 'test/unit'
require 'test_declarative'
require 'pp'
require 'minimal'

alias :require_dependency :require

Minimal::Template.send(:include, Minimal::Template::FormBuilderProxy)

ActionView::Template.register_template_handler('rb', Minimal::Template::Handler)

ActionView::Base.class_eval { def protect_against_forgery?; false end } # HAX

VIEW_PATH = File.expand_path('../fixtures/views', __FILE__)

class Record
def self.model_name; ActiveModel::Name.new(self) end
def id; 1 end
end

module TestMethod
def self.included(base)
base.class_eval do
def self.test(name, &block)
test_name = "test_#{name.gsub(/\s+/,'_')}".to_sym
defined = instance_method(test_name) rescue false
raise "#{test_name} is already defined in #{self}" if defined
if block_given?
define_method(test_name, &block)
else
define_method(test_name) do
flunk "No implementation provided for #{name}"
end
end
end
end
end
end

class Module
include TestMethod
end

class Test::Unit::TestCase
include TestMethod
end
VIEW_PATH = File.expand_path('../fixtures/views', __FILE__)

0 comments on commit d4da96c

Please sign in to comment.