Class: Fix::Test Private
- Inherits:
-
Object
- Object
- Fix::Test
- Defined in:
- lib/fix/test.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Wraps the target of the specs document.
Instance Attribute Summary collapse
-
#configuration ⇒ Hash
readonly
private
The settings.
-
#results ⇒ Array
readonly
private
The results.
-
#total_time ⇒ Float
readonly
private
The total time.
Instance Method Summary collapse
-
#fail? ⇒ Boolean
private
Return false if the test fail.
-
#initialize(front_object, options = {}, &specs) ⇒ Test
constructor
private
Initialize the test class.
-
#pass? ⇒ Boolean
private
The state of the test.
-
#report ⇒ Report
private
The report of the test.
-
#statistics ⇒ Hash
private
Some statistics.
Constructor Details
#initialize(front_object, options = {}, &specs) ⇒ Test
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initialize the test class.
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/fix/test.rb', line 15 def initialize(front_object, = {}, &specs) @configuration = { verbose: true } @configuration.update() start_time = Time.now g = On.new(front_object, [], [], @configuration) g.instance_eval(&specs) @results = g.results @total_time = Time.now - start_time end |
Instance Attribute Details
#configuration ⇒ Hash (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns The settings.
31 32 33 |
# File 'lib/fix/test.rb', line 31 def configuration @configuration end |
#results ⇒ Array (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns The results.
36 37 38 |
# File 'lib/fix/test.rb', line 36 def results @results end |
#total_time ⇒ Float (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns The total time.
41 42 43 |
# File 'lib/fix/test.rb', line 41 def total_time @total_time end |
Instance Method Details
#fail? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return false if the test fail.
70 71 72 |
# File 'lib/fix/test.rb', line 70 def fail? !pass? end |
#pass? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
The state of the test.
65 66 67 |
# File 'lib/fix/test.rb', line 65 def pass? results.all?(&:result?) end |
#report ⇒ Report
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
The report of the test.
58 59 60 |
# File 'lib/fix/test.rb', line 58 def report Report.new(self) end |
#statistics ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Some statistics.
46 47 48 49 50 51 52 53 |
# File 'lib/fix/test.rb', line 46 def statistics { pass_percent: pass_percent, total_infos: results.count { |r| r.to_char == 'I' }, total_failures: results.count { |r| r.to_char == 'F' }, total_errors: results.count { |r| r.to_char == 'E' } } end |