Class: RSpec::Unit::TestCase
- Inherits:
-
Core::ExampleGroup
show all
- Defined in:
- lib/rspec/unit/test_case.rb
Defined Under Namespace
Classes: ExamplesCollection
Constant Summary
- TEST_METHOD_PATTERN =
/^test_/
Constants included
from Assertions
Assertions::UncaughtThrow
Class Method Summary
(collapse)
Instance Method Summary
(collapse)
Methods included from Assertions
#assert, #assert_block, #assert_equal, #assert_in_delta, #assert_instance_of, #assert_kind_of, #assert_match, #assert_nil, #assert_no_match, #assert_not_equal, #assert_not_nil, #assert_not_same, #assert_nothing_raised, #assert_nothing_thrown, #assert_operator, #assert_raise, #assert_raises, #assert_respond_to, #assert_same, #assert_send, #assert_throws, #build_message, #flunk, use_pp=
Constructor Details
A new instance of TestCase
121
122
123
124
|
# File 'lib/rspec/unit/test_case.rb', line 121
def initialize
@test_passed = true
super
end
|
Class Method Details
+ (Object) ancestors
53
54
55
|
# File 'lib/rspec/unit/test_case.rb', line 53
def self.ancestors
super[0..-2]
end
|
+ (Object) examples
49
50
51
|
# File 'lib/rspec/unit/test_case.rb', line 49
def self.examples
@tc_examples ||= ExamplesCollection.new(self, super)
end
|
+ (Object) inherited(klass)
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/rspec/unit/test_case.rb', line 21
def self.inherited(klass)
super
install_setup_and_teardown(klass)
klass.set_it_up(test_case_name(klass), {:caller => caller})
klass.metadata[:example_group][:test_unit] = true
children << klass
world.example_groups << klass
end
|
+ (Object) method_added(id)
40
41
42
43
44
45
46
47
|
# File 'lib/rspec/unit/test_case.rb', line 40
def self.method_added(id)
name = id.to_s
if test_method?(name)
caller_lines[name] = caller
test_method_metadata[name] = @_metadata_for_next
@_metadata_for_next = nil
end
end
|
+ (Object) test_case_info(options)
32
33
34
|
# File 'lib/rspec/unit/test_case.rb', line 32
def self.test_case_info(options)
metadata[:example_group].update(options)
end
|
+ (Object) test_info(options)
36
37
38
|
# File 'lib/rspec/unit/test_case.rb', line 36
def self.test_info(options)
@_metadata_for_next = options
end
|
Instance Method Details
- (Object) execute(method)
132
133
134
135
136
137
138
139
|
# File 'lib/rspec/unit/test_case.rb', line 132
def execute(method)
begin
send(method.to_sym)
rescue
@test_passed = false
raise
end
end
|
- (Object) setup
126
127
|
# File 'lib/rspec/unit/test_case.rb', line 126
def setup
end
|
- (Object) teardown
129
130
|
# File 'lib/rspec/unit/test_case.rb', line 129
def teardown
end
|