Class: GUnit::TestResponse

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

Constant Summary collapse

DEFAULT_MESSAGE =
''

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ TestResponse

FailResponse.new(“my message”)



11
12
13
14
15
# File 'lib/gunit/test_response.rb', line 11

def initialize(*args)
  self.message = args.find{|arg| arg.is_a?(String) } || self.class::DEFAULT_MESSAGE
  self.backtrace = args.find{|arg| arg.is_a?(Array) } || []
  self.test_case = args.find{|arg| arg.is_a?(GUnit::TestCase) }
end

Instance Attribute Details

#backtraceObject

Returns the value of attribute backtrace.



8
9
10
# File 'lib/gunit/test_response.rb', line 8

def backtrace
  @backtrace
end

#file_nameObject (readonly)

Returns the value of attribute file_name.



8
9
10
# File 'lib/gunit/test_response.rb', line 8

def file_name
  @file_name
end

#line_numberObject (readonly)

Returns the value of attribute line_number.



8
9
10
# File 'lib/gunit/test_response.rb', line 8

def line_number
  @line_number
end

#messageObject

Returns the value of attribute message.



7
8
9
# File 'lib/gunit/test_response.rb', line 7

def message
  @message
end

#test_caseObject

Returns the value of attribute test_case.



7
8
9
# File 'lib/gunit/test_response.rb', line 7

def test_case
  @test_case
end