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.



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

def result
  @result
end

Class Method Details

.priority_mode=(bool) ⇒ Object



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

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

Instance Method Details

#apply_priorityObject



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

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

#need_to_run?Boolean

Returns:

  • (Boolean)


172
173
174
175
# File 'lib/test-unit-ext/priority.rb', line 172

def need_to_run?
  apply_priority
  !@tests.empty?
end

#run(result, &block) ⇒ Object



157
158
159
160
161
162
163
164
165
166
# File 'lib/test-unit-ext/priority.rb', line 157

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



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

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



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

alias_method :run_without_priority_support, :run