run_examples() public

No documentation

This method has no description. You can help the RSpec community by adding new notes.

Hide source
# File lib/spec/runner/options.rb, line 80
      def run_examples
        return true unless examples_should_be_run?
        success = true
        begin
          runner = custom_runner || ExampleGroupRunner.new(self)

          unless @files_loaded
            runner.load_files(files_to_load)
            @files_loaded = true
          end
          
          define_predicate_matchers
          plugin_mock_framework

          # TODO - this has to happen after the files get loaded,
          # otherwise the before_suite_parts are not populated
          # from the configuration. There is no spec for this
          # directly, but features/before_and_after_blocks/before_and_after_blocks.story
          # will fail if this happens before the files are loaded.
          before_suite_parts.each do |part|
            part.call
          end

          if example_groups.empty?
            true
          else
            set_spec_from_line_number if line_number
            success = runner.run
            @examples_run = true
            heckle if heckle_runner
            success
          end
        ensure
          after_suite_parts.each do |part|
            part.arity < 1 ? part.call : part.call(success)
          end
        end
      end
Register or log in to add new notes.