lib/cucumber/parser/feature.tt in square-cucumber-0.3.12.2 vs lib/cucumber/parser/feature.tt in square-cucumber-0.3.93.1

- old
+ new

@@ -19,11 +19,15 @@ feature_elements comment? { def has_tags?(tag_names) tags.has_tags?(tag_names) end - + + def has_all_tags?(tag_names) + tags.has_all_tags?(tag_names) + end + def build(filter) if(filter.nil? || feature_elements.accept?(filter) || (!bg.empty? && filter.accept?(bg))) background = bg.respond_to?(:build) ? bg.build : nil Ast::Feature.new( background, @@ -45,10 +49,14 @@ def has_tags?(tags) (tag_names & tags).any? end + def has_all_tags?(tags) + (tags & tag_names) == tags + end + def build Ast::Tags.new(ts.line, tag_names) end def tag_names @@ -87,10 +95,15 @@ def has_tags?(tag_names) feature_tags = self.parent.tags feature_tags.has_tags?(tag_names) end + def has_all_tags?(tag_names) + feature_tags = self.parent.tags + feature_tags.has_all_tags?(tag_names) + end + def build Ast::Background.new( comment.build, background_keyword.line, background_keyword.text_value, @@ -128,10 +141,15 @@ def has_tags?(tag_names) feature_tags = self.parent.parent.tags tags.has_tags?(tag_names) || feature_tags.has_tags?(tag_names) end + def has_all_tags?(tag_names) + feature_tags = self.parent.parent.tags + tags.has_all_tags?(tag_names) || feature_tags.has_all_tags?(tag_names) + end + def matches_name?(regexp_to_match) name.build =~ regexp_to_match end def build(background, filter) @@ -164,10 +182,15 @@ def has_tags?(tag_names) feature_tags = self.parent.parent.tags tags.has_tags?(tag_names) || feature_tags.has_tags?(tag_names) end + def has_all_tags?(tag_names) + feature_tags = self.parent.parent.tags + tags.has_all_tags?(tag_names) || feature_tags.has_all_tags?(tag_names) + end + def matches_name?(regexp_to_match) outline_matches_name?(regexp_to_match) || examples_sections.matches_name?(regexp_to_match) end def outline_matches_name?(regexp_to_match) @@ -244,9 +267,13 @@ examples_keyword.line == line || table.at_line?(line) end def has_tags?(tag_names) + true + end + + def has_all_tags?(tag_names) true end def outline_at_line?(line) true