Class: Rproof::Test
- Inherits:
-
Object
- Object
- Rproof::Test
- Defined in:
- lib/rproof/test.rb
Direct Known Subclasses
Instance Method Summary collapse
- #clean_up ⇒ Object
- #execute ⇒ Object
-
#initialize(reporter, name, description = nil) ⇒ Test
constructor
A new instance of Test.
- #run ⇒ Object
- #setup ⇒ Object
Constructor Details
#initialize(reporter, name, description = nil) ⇒ Test
Returns a new instance of Test.
10 11 12 13 14 15 16 |
# File 'lib/rproof/test.rb', line 10 def initialize(reporter, name, description = nil) @id = object_id @reporter = reporter @name = name @description = description @censor = Censor.new reporter, name, description end |
Instance Method Details
#clean_up ⇒ Object
25 26 |
# File 'lib/rproof/test.rb', line 25 def clean_up end |
#execute ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/rproof/test.rb', line 28 def execute @reporter.report_test_begin(@id, @name, @description) begin setup run clean_up rescue Exception => e @censor.log_exception e end @reporter.report_test_end(@id, @censor.test_result) @censor.test_result end |
#run ⇒ Object
21 22 23 |
# File 'lib/rproof/test.rb', line 21 def run raise "This method has to be overriden. Please redefine 'run' method with your test code." end |
#setup ⇒ Object
18 19 |
# File 'lib/rproof/test.rb', line 18 def setup end |