Class: Result

Inherits:
Object
  • Object
show all
Defined in:
lib/result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(testcase, response) ⇒ Result

Returns a new instance of Result.



5
6
7
8
9
10
# File 'lib/result.rb', line 5

def initialize(testcase, response)
  @succeeded = true
  @testcase = testcase
  @response = response
  @error_message = nil
end

Instance Attribute Details

#error_messageObject

Returns the value of attribute error_message.



3
4
5
# File 'lib/result.rb', line 3

def error_message
  @error_message
end

#responseObject

Returns the value of attribute response.



3
4
5
# File 'lib/result.rb', line 3

def response
  @response
end

#succeededObject

Returns the value of attribute succeeded.



3
4
5
# File 'lib/result.rb', line 3

def succeeded
  @succeeded
end

#testcaseObject

Returns the value of attribute testcase.



3
4
5
# File 'lib/result.rb', line 3

def testcase
  @testcase
end

Instance Method Details

#honk_in(verbosity, index) ⇒ Object

honk out the errors message corresponding to the verbosity configuration the user took



13
14
15
16
# File 'lib/result.rb', line 13

def honk_in(verbosity, index)
  verbosity ||= "rspec"
  self.send(verbosity.to_sym, index)
end

#success?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/result.rb', line 18

def success?
  return @succeeded
end