Class: Test::Unit::TestCase
- Inherits:
-
Object
- Object
- Test::Unit::TestCase
show all
- Includes:
- ActionController::TestProcess
- Defined in:
- lib/test/test_helper.rb
Overview
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.attachment_model(klass = nil) ⇒ Object
64
65
66
67
|
# File 'lib/test/test_helper.rb', line 64
def self.attachment_model(klass = nil)
@attachment_model = klass if klass
@attachment_model
end
|
.test_against_class(test_method, klass, subclass = false) ⇒ Object
69
70
71
72
73
74
75
|
# File 'lib/test/test_helper.rb', line 69
def self.test_against_class(test_method, klass, subclass = false)
define_method("#{test_method}_on_#{:sub if subclass}class") do
klass = Class.new(klass) if subclass
attachment_model klass
send test_method, klass
end
end
|
.test_against_subclass(test_method, klass) ⇒ Object
77
78
79
|
# File 'lib/test/test_helper.rb', line 77
def self.test_against_subclass(test_method, klass)
test_against_class test_method, klass, true
end
|
Instance Method Details
#create_fixtures(*table_names) ⇒ Object
43
44
45
46
47
48
49
|
# File 'lib/test/test_helper.rb', line 43
def create_fixtures(*table_names)
if block_given?
Fixtures.create_fixtures(Test::Unit::TestCase.fixture_path, table_names) { yield }
else
Fixtures.create_fixtures(Test::Unit::TestCase.fixture_path, table_names)
end
end
|
#teardown ⇒ Object
57
58
59
|
# File 'lib/test/test_helper.rb', line 57
def teardown
FileUtils.rm_rf File.join(File.dirname(__FILE__), 'files')
end
|