Sha256: 06413776acf41aeb5fd9e8c9052c5e16942d06c9b0af581a1eeab99abbc49483

Contents?: true

Size: 1.25 KB

Versions: 60

Compression:

Stored size: 1.25 KB

Contents

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

      def load_files(files)
        # 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
        end
        return success
      ensure
        finish
      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
    # TODO: BT - Deprecate BehaviourRunner?
    BehaviourRunner = ExampleGroupRunner
  end
end

Version data entries

60 entries across 60 versions & 10 rubygems

Version Path
dchelimsky-rspec-1.1.10 lib/spec/runner/example_group_runner.rb
dchelimsky-rspec-1.1.11.1 lib/spec/runner/example_group_runner.rb
dchelimsky-rspec-1.1.11 lib/spec/runner/example_group_runner.rb
jnstq-acts_as_sms-0.1.0 test/vendor/plugins/rspec/lib/spec/runner/example_group_runner.rb
jnstq-acts_as_sms-0.1.1 test/vendor/plugins/rspec/lib/spec/runner/example_group_runner.rb
jnstq-acts_as_sms-0.1.3 test/vendor/plugins/rspec/lib/spec/runner/example_group_runner.rb
jnstq-acts_as_sms-0.1.4 test/vendor/plugins/rspec/lib/spec/runner/example_group_runner.rb
merb-core-1.1.3 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/lib/spec/runner/example_group_runner.rb
merb-core-1.1.2 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/lib/spec/runner/example_group_runner.rb
merb-core-1.1.1 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/lib/spec/runner/example_group_runner.rb
merb-core-1.1.0 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/lib/spec/runner/example_group_runner.rb
merb-core-1.1.0.rc1 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/lib/spec/runner/example_group_runner.rb
merb-core-1.1.0.pre spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/lib/spec/runner/example_group_runner.rb
mack-0.8.2 lib/gems/rspec-1.1.11/lib/spec/runner/example_group_runner.rb
picolena-0.0.99 app_generators/picolena/templates/vendor/plugins/rspec/lib/spec/runner/example_group_runner.rb
picolena-0.1.1 rails_plugins/rspec/lib/spec/runner/example_group_runner.rb
picolena-0.1.0 rails_plugins/rspec/lib/spec/runner/example_group_runner.rb
picolena-0.1.2 rails_plugins/rspec/lib/spec/runner/example_group_runner.rb
picolena-0.1.4 rails_plugins/rspec/lib/spec/runner/example_group_runner.rb
picolena-0.1.3 rails_plugins/rspec/lib/spec/runner/example_group_runner.rb