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



118
119
120
# File 'lib/test-unit-ext/priority.rb', line 118

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

Instance Method Details

#apply_priorityObject



135
136
137
# File 'lib/test-unit-ext/priority.rb', line 135

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

#need_to_run?Boolean

Returns:

  • (Boolean)


139
140
141
142
# File 'lib/test-unit-ext/priority.rb', line 139

def need_to_run?
  apply_priority
  !@tests.empty?
end

#run(result, &block) ⇒ Object



124
125
126
127
128
129
130
131
132
133
# File 'lib/test-unit-ext/priority.rb', line 124

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



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

alias_method :run_without_priority_support, :run