Sha256: 7c6d60c3ae77cab0f4a04e22dbc103a4aa71f559147a34bab0589dbad90457ac

Contents?: true

Size: 1.21 KB

Versions: 11

Compression:

Stored size: 1.21 KB

Contents

module Spec
  module Runner
    class ExampleGroupRunner
      def initialize(options)
        @options = options
      end

      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

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

    protected

      def prepare
        reporter.start(number_of_examples)
        example_groups.reverse! if reverse
      end

      def finish
        reporter.end
        reporter.dump
      end

      def reporter
        @options.reporter
      end

      def reverse
        @options.reverse
      end

      def example_groups
        @options.example_groups
      end

      def number_of_examples
        @options.number_of_examples
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 4 rubygems

Version Path
radiant-1.0.0 ruby-debug/ruby/1.8/gems/rspec-1.3.2/lib/spec/runner/example_group_runner.rb
rspec-1.3.2 lib/spec/runner/example_group_runner.rb
rspec-1.3.1 lib/spec/runner/example_group_runner.rb
rspec-1.3.1.rc lib/spec/runner/example_group_runner.rb
rspec-1.3.0 lib/spec/runner/example_group_runner.rb
media-path-0.1.2 vendor/rspec/lib/spec/runner/example_group_runner.rb
media-path-0.1.1.pre vendor/rspec/lib/spec/runner/example_group_runner.rb
media-path-0.1.1 vendor/rspec/lib/spec/runner/example_group_runner.rb
rango-0.0.6 vendor/rspec/lib/spec/runner/example_group_runner.rb
rango-0.1.pre vendor/rspec/lib/spec/runner/example_group_runner.rb
media-path-0.1 vendor/rspec/lib/spec/runner/example_group_runner.rb