Skip to content

Commit

Permalink
Move LocationFilter into core
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwynne committed Nov 26, 2013
1 parent aae2f0b commit cebcd29
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions lib/cucumber/runtime.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ def load_programming_language(language)
@support_code.load_programming_language(language)
end

require 'cucumber/core/test/tag_filter'
def run!
load_step_definitions
fire_after_configuration_hook
Expand Down Expand Up @@ -254,31 +253,18 @@ def report
@report ||= Cucumber::Formatter::ReportAdapter.new(self, @configuration.formatters(self))
end

require 'cucumber/core/test/name_filter'
require 'cucumber/core/test/filters'
def filters
tag_expressions = @configuration.tag_expressions
name_regexps = @configuration.name_regexps
[
[Cucumber::Core::Test::TagFilter, [tag_expressions]],
[Cucumber::Core::Test::NameFilter, [name_regexps]],
[LocationFilter, [filespecs.locations]],
[Cucumber::Core::Test::LocationsFilter, [filespecs.locations]],
[Quit, []],
]
end

class LocationFilter
def initialize(locations, receiver)
@receiver = receiver
@locations = locations
end

def test_case(test_case)
if test_case.match_locations?(@locations)
test_case.describe_to @receiver
end
end
end

class Quit
def initialize(receiver)
@receiver = receiver
Expand Down

0 comments on commit cebcd29

Please sign in to comment.