Class Spec::Runner::ExampleGroupRunner

  1. lib/spec/runner/example_group_runner.rb
Parent: Object

Methods

public class

  1. new

public instance

  1. load_files
  2. run

protected instance

  1. example_groups
  2. finish
  3. number_of_examples
  4. prepare
  5. reporter
  6. reverse

Public class methods

new (options)
[show source]
# File lib/spec/runner/example_group_runner.rb, line 4
      def initialize(options)
        @options = options
      end

Public instance methods

load_files (files)
[show source]
# 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
run ()
[show source]
# 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
        return success
      ensure
        finish
      end

Protected instance methods

example_groups ()
[show source]
# File lib/spec/runner/example_group_runner.rb, line 50
      def example_groups
        @options.example_groups
      end
finish ()
[show source]
# File lib/spec/runner/example_group_runner.rb, line 37
      def finish
        reporter.end
        reporter.dump
      end
number_of_examples ()
[show source]
# File lib/spec/runner/example_group_runner.rb, line 54
      def number_of_examples
        @options.number_of_examples
      end
prepare ()
[show source]
# File lib/spec/runner/example_group_runner.rb, line 32
      def prepare
        reporter.start(number_of_examples)
        example_groups.reverse! if reverse
      end
reporter ()
[show source]
# File lib/spec/runner/example_group_runner.rb, line 42
      def reporter
        @options.reporter
      end
reverse ()
[show source]
# File lib/spec/runner/example_group_runner.rb, line 46
      def reverse
        @options.reverse
      end