lib/cucumber/parser/feature.rb in jwilger-cucumber-0.3.11.200906161550 vs lib/cucumber/parser/feature.rb in jwilger-cucumber-0.3.11.200907091518

- old
+ new

@@ -53,10 +53,14 @@ module FeatureSub2 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( @@ -209,10 +213,14 @@ module Tags2 def at_line?(line) ts.elements.detect{|e| e.tag.line == line} end + def has_all_tags?(tags) + (tags & tag_names) == tags + end + def has_tags?(tags) (tag_names & tags).any? end def build @@ -489,10 +497,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, @@ -686,10 +699,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) @@ -824,10 +842,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) @@ -1157,9 +1180,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