Sha256: bbe4b4926a5ae333d456f4c3bad31417183308321cc2ba4499f6e8cc4562a77c
Contents?: true
Size: 931 Bytes
Versions: 20
Compression:
Stored size: 931 Bytes
Contents
# frozen_string_literal: true require 'cucumber/core/filter' module Cucumber module Core module Test # Sorts and filters scenarios based on a list of locations class LocationsFilter < Filter.new(:filter_locations) def test_case(test_case) test_cases[test_case.location.file] << test_case self end def done sorted_test_cases.each do |test_case| test_case.describe_to receiver end receiver.done self end private def sorted_test_cases filter_locations.map { |filter_location| test_cases[filter_location.file].select { |test_case| filter_location.match?(test_case.location) } }.flatten.uniq end def test_cases @test_cases ||= Hash.new { |hash, key| hash[key] = [] } end end end end end
Version data entries
20 entries across 20 versions & 3 rubygems