Class: Fitting::Report::Test

Inherits:
Object
  • Object
show all
Defined in:
lib/fitting/report/test.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#idObject (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

#bodyObject



36
37
38
# File 'lib/fitting/report/test.rb', line 36

def body
  @test['response']['body']
end

#mark_actionObject



44
45
46
# File 'lib/fitting/report/test.rb', line 44

def mark_action
  @action = true
end

#mark_combinationObject



52
53
54
# File 'lib/fitting/report/test.rb', line 52

def mark_combination
  @combination = true
end

#mark_prefixObject



40
41
42
# File 'lib/fitting/report/test.rb', line 40

def mark_prefix
  @prefix = true
end

#mark_responseObject



48
49
50
# File 'lib/fitting/report/test.rb', line 48

def mark_response
  @response = true
end

#methodObject



28
29
30
# File 'lib/fitting/report/test.rb', line 28

def method
  @test['method']
end

#pathObject



24
25
26
# File 'lib/fitting/report/test.rb', line 24

def path
  @test['path']
end

#statusObject



32
33
34
# File 'lib/fitting/report/test.rb', line 32

def status
  @test['response']['status'].to_s
end

#there_a_prefix?Boolean

Returns:

  • (Boolean)


56
57
58
# File 'lib/fitting/report/test.rb', line 56

def there_a_prefix?
  @prefix
end

#there_an_actions?Boolean

Returns:

  • (Boolean)


60
61
62
# File 'lib/fitting/report/test.rb', line 60

def there_an_actions?
  @action
end

#there_an_combinations?Boolean

Returns:

  • (Boolean)


68
69
70
# File 'lib/fitting/report/test.rb', line 68

def there_an_combinations?
  @combination
end

#there_an_responses?Boolean

Returns:

  • (Boolean)


64
65
66
# File 'lib/fitting/report/test.rb', line 64

def there_an_responses?
  @response
end

#to_hObject



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