Class: Fitting::Report::Test

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

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 Method Details

#bodyObject



38
39
40
# File 'lib/fitting/report/test.rb', line 38

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

#idObject



13
14
15
# File 'lib/fitting/report/test.rb', line 13

def id
  @id
end

#is_there_a_prefix?Boolean

Returns:

  • (Boolean)


58
59
60
# File 'lib/fitting/report/test.rb', line 58

def is_there_a_prefix?
  @prefix
end

#is_there_an_actions?Boolean

Returns:

  • (Boolean)


62
63
64
# File 'lib/fitting/report/test.rb', line 62

def is_there_an_actions?
  @action
end

#is_there_an_combinations?Boolean

Returns:

  • (Boolean)


70
71
72
# File 'lib/fitting/report/test.rb', line 70

def is_there_an_combinations?
  @combination
end

#is_there_an_responses?Boolean

Returns:

  • (Boolean)


66
67
68
# File 'lib/fitting/report/test.rb', line 66

def is_there_an_responses?
  @response
end

#mark_actionObject



46
47
48
# File 'lib/fitting/report/test.rb', line 46

def mark_action
  @action = true
end

#mark_combinationObject



54
55
56
# File 'lib/fitting/report/test.rb', line 54

def mark_combination
  @combination = true
end

#mark_prefixObject



42
43
44
# File 'lib/fitting/report/test.rb', line 42

def mark_prefix
  @prefix = true
end

#mark_responseObject



50
51
52
# File 'lib/fitting/report/test.rb', line 50

def mark_response
  @response = true
end

#methodObject



30
31
32
# File 'lib/fitting/report/test.rb', line 30

def method
  @test['method']
end

#pathObject



26
27
28
# File 'lib/fitting/report/test.rb', line 26

def path
  @test['path']
end

#statusObject



34
35
36
# File 'lib/fitting/report/test.rb', line 34

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

#to_hObject



17
18
19
20
21
22
23
24
# File 'lib/fitting/report/test.rb', line 17

def to_h
  {
      path: path,
      method: method,
      status: status,
      body: body
  }
end