Class: Spectre::Runner

Inherits:
Object show all
Defined in:
lib/spectre.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.currentObject



194
195
196
# File 'lib/spectre.rb', line 194

def self.current
  Thread.current.thread_variable_get('current_run')
end

.current=(run) ⇒ Object



198
199
200
# File 'lib/spectre.rb', line 198

def self.current= run
  Thread.current.thread_variable_set('current_run', run)
end

Instance Method Details

#run(specs) ⇒ Object



202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# File 'lib/spectre.rb', line 202

def run specs
  runs = []

  specs.group_by { |x| x.subject }.each do |subject, subject_specs|
    Spectre::Logging.log_subject subject do
      subject_specs.group_by { |x| x.context }.each do |context, context_specs|
        Spectre::Logging.log_context(context) do
          runs.concat run_context(context, context_specs)
        end
      end
    end
  end

  runs
end