Class: Spec::Runner::ExampleGroupRunner

Inherits:
Object
  • Object
show all
Defined in:
lib/spec/runner/example_group_runner.rb

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ ExampleGroupRunner

Returns a new instance of ExampleGroupRunner.



4
5
6
# File 'lib/spec/runner/example_group_runner.rb', line 4

def initialize(options)
  @options = options
end

Instance Method Details

#load_files(files) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/spec/runner/example_group_runner.rb', line 8

def load_files(files)
  $KCODE = 'u' if RUBY_VERSION.to_f < 1.9
  # It's important that loading files (or choosing not to) stays the
  # responsibility of the ExampleGroupRunner. Some implementations (like)
  # the one using DRb may choose *not* to load files, but instead tell
  # someone else to do it over the wire.
  files.each do |file|
    load file
  end
end

#runObject



19
20
21
22
23
24
25
26
27
# File 'lib/spec/runner/example_group_runner.rb', line 19

def run
  prepare
  success = true
  example_groups.each do |example_group|
    success = success & example_group.run(@options)
  end
  finish
  success
end