Class: Raptest::Test
- Inherits:
-
Object
- Object
- Raptest::Test
- Defined in:
- lib/raptest/test.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
Returns the value of attribute errors.
-
#finished_at ⇒ Object
Returns the value of attribute finished_at.
-
#processed ⇒ Object
Returns the value of attribute processed.
-
#started_at ⇒ Object
Returns the value of attribute started_at.
-
#targets ⇒ Object
Returns the value of attribute targets.
Instance Method Summary collapse
- #duration ⇒ Object
-
#initialize(*targets) ⇒ Test
constructor
A new instance of Test.
- #run ⇒ Object
Constructor Details
Instance Attribute Details
#errors ⇒ Object
Returns the value of attribute errors.
6 7 8 |
# File 'lib/raptest/test.rb', line 6 def errors @errors end |
#finished_at ⇒ Object
Returns the value of attribute finished_at.
6 7 8 |
# File 'lib/raptest/test.rb', line 6 def finished_at @finished_at end |
#processed ⇒ Object
Returns the value of attribute processed.
6 7 8 |
# File 'lib/raptest/test.rb', line 6 def processed @processed end |
#started_at ⇒ Object
Returns the value of attribute started_at.
6 7 8 |
# File 'lib/raptest/test.rb', line 6 def started_at @started_at end |
#targets ⇒ Object
Returns the value of attribute targets.
6 7 8 |
# File 'lib/raptest/test.rb', line 6 def targets @targets end |
Instance Method Details
#duration ⇒ Object
14 15 16 |
# File 'lib/raptest/test.rb', line 14 def duration @start_time && @end_time ? ( @end_time - @start_time ) : 0 end |
#run ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/raptest/test.rb', line 18 def run @started_at = Time.now @errors = 0 @processed = 0 targets.each do |asset| @processed += 1 begin asset.test! rescue Exception => e @errors += 1 raise e end end @finished_at = Time.now end |