Sha256: 4d509cc4f30f286d2d66155f0d52d7696425ac063c68e5863d4af028f341a855

Contents?: true

Size: 453 Bytes

Versions: 3

Compression:

Stored size: 453 Bytes

Contents

module RSpecSearchAndDestroy
  class ReorderAndFilter
    attr_reader :source

    def initialize(source)
      @source = source
    end

    def block
      lambda do |examples|
        locations = source.example_locations_to_run

        enabled_examples = examples.select do |e|
          locations.include? e.location
        end

        enabled_examples.sort_by do |e|
          locations.index(e.location)
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rspec-search-and-destroy-0.0.4 lib/rspec-search-and-destroy/reorder_and_filter.rb
rspec-search-and-destroy-0.0.3 lib/rspec-search-and-destroy/reorder_and_filter.rb
rspec-search-and-destroy-0.0.2 lib/rspec-search-and-destroy/reorder_and_filter.rb