Sha256: e144bc68168673d722839f8a15e1c10aa081ac9f251898929e20e660998c5589

Contents?: true

Size: 995 Bytes

Versions: 28

Compression:

Stored size: 995 Bytes

Contents

module Spec
  module Runner
    class Options
      def run_one_example(identifier)
        example = identifier.locate(example_groups)
        SingleExampleRunner.new(self, example).run
      end

      class SingleExampleRunner < ExampleGroupRunner
        def initialize(options, example)
          super(options)
          @example = example
          example_group.extend ExampleGroupHelper
        end

        def example_group
          @example.class
        end

        def example_groups
          [example_group]
        end

        def run
          example_group.with_example_objects([@example]) do
            super
          end
        end

        module ExampleGroupHelper
          def with_example_objects(example_objects)
            original_example_objects = @example_objects
            @example_objects = example_objects
            yield
          ensure
            @example_objects = original_example_objects
          end
        end
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 5 rubygems

Version Path
jason-o-matic-deep_test-1.2.2.1 lib/deep_test/spec/extensions/options.rb
jason-o-matic-deep_test-1.2.2.10 lib/deep_test/spec/extensions/options.rb
jason-o-matic-deep_test-1.2.2.11 lib/deep_test/spec/extensions/options.rb
jason-o-matic-deep_test-1.2.2.12 lib/deep_test/spec/extensions/options.rb
jason-o-matic-deep_test-1.2.2.13 lib/deep_test/spec/extensions/options.rb
jason-o-matic-deep_test-1.2.2.14 lib/deep_test/spec/extensions/options.rb
jason-o-matic-deep_test-1.2.2.2 lib/deep_test/spec/extensions/options.rb
jason-o-matic-deep_test-1.2.2.3 lib/deep_test/spec/extensions/options.rb
jason-o-matic-deep_test-1.2.2.4 lib/deep_test/spec/extensions/options.rb
jason-o-matic-deep_test-1.2.2.5 lib/deep_test/spec/extensions/options.rb
jason-o-matic-deep_test-1.2.2.6 lib/deep_test/spec/extensions/options.rb
jason-o-matic-deep_test-1.2.2.7 lib/deep_test/spec/extensions/options.rb
jason-o-matic-deep_test-1.2.2.8 lib/deep_test/spec/extensions/options.rb
jason-o-matic-deep_test-1.2.2.9 lib/deep_test/spec/extensions/options.rb
jperkins-deep_test-1.2.2 lib/deep_test/spec/extensions/options.rb
deep_test_pre-2.0 lib/deep_test/spec/extensions/options.rb
jason-o-matic-deep_test-1.2.2.15 lib/deep_test/spec/extensions/options.rb
jstorimer-deep-test-2.0.0 lib/deep_test/spec/extensions/options.rb
jstorimer-deep-test-1.4.0 lib/deep_test/spec/extensions/options.rb
jstorimer-deep-test-1.3.0 lib/deep_test/spec/extensions/options.rb