Sha256: ca052552f81b3c1c00a5066b55f4aa8d78f1bae2a5c064a913aa7265216291f6

Contents?: true

Size: 509 Bytes

Versions: 8

Compression:

Stored size: 509 Bytes

Contents

module RSpec
  module Core
    module SharedExampleGroup
      class Collection

        def initialize(sources, examples)
          @sources, @examples = sources, examples
        end

        def [](key)
          fetch_examples(key)
        end

        private

          def fetch_examples(key)
            @examples[source_for key][key]
          end

          def source_for(key)
            @sources.reverse.find { |source| @examples[source].has_key? key }
          end

      end
    end
  end
end

Version data entries

8 entries across 8 versions & 3 rubygems

Version Path
opal-rspec-cj-0.4.4 vendor_lib/rspec/core/shared_example_group/collection.rb
opal-rspec-0.4.3 vendor_lib/rspec/core/shared_example_group/collection.rb
opal-rspec-0.4.2 vendor_lib/rspec/core/shared_example_group/collection.rb
opal-rspec-0.4.1 vendor_lib/rspec/core/shared_example_group/collection.rb
opal-rspec-0.4.0 vendor_lib/rspec/core/shared_example_group/collection.rb
opal-rspec-0.4.0.beta4 vendor_lib/rspec/core/shared_example_group/collection.rb
rspec-core-3.0.0.beta2 lib/rspec/core/shared_example_group/collection.rb
rspec-core-3.0.0.beta1 lib/rspec/core/shared_example_group/collection.rb