Class: Test::Unit::TestSuite

Inherits:
Object
  • Object
show all
Defined in:
lib/test-unit-ext/priority.rb,
lib/test-unit-ext/xml-report.rb

Constant Summary collapse

@@priority_mode =
false

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#resultObject (readonly)

Returns the value of attribute result.



190
191
192
# File 'lib/test-unit-ext/xml-report.rb', line 190

def result
  @result
end

Class Method Details

.priority_mode=(bool) ⇒ Object



148
149
150
# File 'lib/test-unit-ext/priority.rb', line 148

def priority_mode=(bool)
  @@priority_mode = bool
end

Instance Method Details

#apply_priorityObject



165
166
167
# File 'lib/test-unit-ext/priority.rb', line 165

def apply_priority
  @tests = @tests.reject {|test| !test.need_to_run?}
end

#need_to_run?Boolean

Returns:

  • (Boolean)


169
170
171
172
# File 'lib/test-unit-ext/priority.rb', line 169

def need_to_run?
  apply_priority
  !@tests.empty?
end

#run(result, &block) ⇒ Object



154
155
156
157
158
159
160
161
162
163
# File 'lib/test-unit-ext/priority.rb', line 154

def run(*args, &block)
  priority_mode = @@priority_mode
  if priority_mode
    @original_tests = @tests
    apply_priority
  end
  run_without_priority_support(*args, &block)
ensure
  @tests = @original_tests if priority_mode
end

#run_without_keep_resultObject



192
193
194
195
196
197
198
199
200
201
# File 'lib/test-unit-ext/xml-report.rb', line 192

def run(*args, &block)
  priority_mode = @@priority_mode
  if priority_mode
    @original_tests = @tests
    apply_priority
  end
  run_without_priority_support(*args, &block)
ensure
  @tests = @original_tests if priority_mode
end

#run_without_priority_supportObject



153
# File 'lib/test-unit-ext/priority.rb', line 153

alias_method :run_without_priority_support, :run