Class: Fitting::Report::Test
- Inherits:
-
Object
- Object
- Fitting::Report::Test
- Defined in:
- lib/fitting/report/test.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
- #body ⇒ Object
-
#initialize(test) ⇒ Test
constructor
A new instance of Test.
- #mark_action ⇒ Object
- #mark_combination ⇒ Object
- #mark_prefix ⇒ Object
- #mark_response ⇒ Object
- #method ⇒ Object
- #path ⇒ Object
- #status ⇒ Object
- #there_a_prefix? ⇒ Boolean
- #there_an_actions? ⇒ Boolean
- #there_an_combinations? ⇒ Boolean
- #there_an_responses? ⇒ Boolean
- #to_h ⇒ Object
Constructor Details
#initialize(test) ⇒ Test
Returns a new instance of Test.
4 5 6 7 8 9 10 11 |
# File 'lib/fitting/report/test.rb', line 4 def initialize(test) @test = test @prefix = false @action = false @response = false @combination = false @id = SecureRandom.hex end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
13 14 15 |
# File 'lib/fitting/report/test.rb', line 13 def id @id end |
Instance Method Details
#body ⇒ Object
36 37 38 |
# File 'lib/fitting/report/test.rb', line 36 def body @test['response']['body'] end |
#mark_action ⇒ Object
44 45 46 |
# File 'lib/fitting/report/test.rb', line 44 def mark_action @action = true end |
#mark_combination ⇒ Object
52 53 54 |
# File 'lib/fitting/report/test.rb', line 52 def mark_combination @combination = true end |
#mark_prefix ⇒ Object
40 41 42 |
# File 'lib/fitting/report/test.rb', line 40 def mark_prefix @prefix = true end |
#mark_response ⇒ Object
48 49 50 |
# File 'lib/fitting/report/test.rb', line 48 def mark_response @response = true end |
#method ⇒ Object
28 29 30 |
# File 'lib/fitting/report/test.rb', line 28 def method @test['method'] end |
#path ⇒ Object
24 25 26 |
# File 'lib/fitting/report/test.rb', line 24 def path @test['path'] end |
#status ⇒ Object
32 33 34 |
# File 'lib/fitting/report/test.rb', line 32 def status @test['response']['status'].to_s end |
#there_a_prefix? ⇒ Boolean
56 57 58 |
# File 'lib/fitting/report/test.rb', line 56 def there_a_prefix? @prefix end |
#there_an_actions? ⇒ Boolean
60 61 62 |
# File 'lib/fitting/report/test.rb', line 60 def there_an_actions? @action end |
#there_an_combinations? ⇒ Boolean
68 69 70 |
# File 'lib/fitting/report/test.rb', line 68 def there_an_combinations? @combination end |
#there_an_responses? ⇒ Boolean
64 65 66 |
# File 'lib/fitting/report/test.rb', line 64 def there_an_responses? @response end |
#to_h ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/fitting/report/test.rb', line 15 def to_h { path: path, method: method, status: status, body: body } end |