Class: Test::Unit::UI::JUnitXml::JUnitTestCase

Inherits:
Object
  • Object
show all
Defined in:
lib/test/unit/ui/junitxml/testrunner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(class_name, name, file) ⇒ JUnitTestCase

Returns a new instance of JUnitTestCase.



140
141
142
143
144
145
146
147
148
149
# File 'lib/test/unit/ui/junitxml/testrunner.rb', line 140

def initialize(class_name, name, file)
  @class_name = class_name
  @name = name
  @file = file
  @failure = @error = @omission = @pending = nil
  @stdout = StringIO.new
  @stderr = StringIO.new
  @assertion_count = 0
  @time = 0
end

Instance Attribute Details

#assertion_countObject

Returns the value of attribute assertion_count.



138
139
140
# File 'lib/test/unit/ui/junitxml/testrunner.rb', line 138

def assertion_count
  @assertion_count
end

#class_nameObject (readonly)

Returns the value of attribute class_name.



135
136
137
# File 'lib/test/unit/ui/junitxml/testrunner.rb', line 135

def class_name
  @class_name
end

#errorObject (readonly)

Returns the value of attribute error.



136
137
138
# File 'lib/test/unit/ui/junitxml/testrunner.rb', line 136

def error
  @error
end

#failureObject (readonly)

Returns the value of attribute failure.



136
137
138
# File 'lib/test/unit/ui/junitxml/testrunner.rb', line 136

def failure
  @failure
end

#fileObject (readonly)

Returns the value of attribute file.



135
136
137
# File 'lib/test/unit/ui/junitxml/testrunner.rb', line 135

def file
  @file
end

#nameObject (readonly)

Returns the value of attribute name.



135
136
137
# File 'lib/test/unit/ui/junitxml/testrunner.rb', line 135

def name
  @name
end

#omissionObject (readonly)

Returns the value of attribute omission.



136
137
138
# File 'lib/test/unit/ui/junitxml/testrunner.rb', line 136

def omission
  @omission
end

#pendingObject (readonly)

Returns the value of attribute pending.



136
137
138
# File 'lib/test/unit/ui/junitxml/testrunner.rb', line 136

def pending
  @pending
end

#stderrObject (readonly)

Returns the value of attribute stderr.



137
138
139
# File 'lib/test/unit/ui/junitxml/testrunner.rb', line 137

def stderr
  @stderr
end

#stdoutObject (readonly)

Returns the value of attribute stdout.



137
138
139
# File 'lib/test/unit/ui/junitxml/testrunner.rb', line 137

def stdout
  @stdout
end

#timeObject

Returns the value of attribute time.



138
139
140
# File 'lib/test/unit/ui/junitxml/testrunner.rb', line 138

def time
  @time
end

Instance Method Details

#<<(fault) ⇒ Object



151
152
153
154
155
156
157
158
159
160
161
162
163
# File 'lib/test/unit/ui/junitxml/testrunner.rb', line 151

def <<(fault)
  # Notification is ignored
  case fault
  when Failure
    @failure = fault
  when Error
    @error = fault
  when Omission
    @omission = fault
  when Pending
    @pending = fault
  end
end

#skipped?Boolean

Returns:

  • (Boolean)


165
166
167
# File 'lib/test/unit/ui/junitxml/testrunner.rb', line 165

def skipped?
  @omission || @pending
end