lib/cucumber/ast/feature_element.rb in aslakhellesoy-cucumber-0.3.0.1 vs lib/cucumber/ast/feature_element.rb in aslakhellesoy-cucumber-0.3.1
- old
+ new
@@ -1,9 +1,11 @@
require 'enumerator'
module Cucumber
module FeatureElement
+ attr_writer :feature
+
def attach_steps(steps)
steps.each {|step| step.feature_element = self}
end
def file_colon_line(line = @line)
@@ -26,13 +28,13 @@
line_number == 0 ? @keyword.jlength + line.jlength : line.jlength + Ast::Step::INDENT - 1 # We -1 as names which are not keyword lines are missing a space between keyword and name
end
end
end
- def matches_scenario_names?(scenario_names)
- scenario_names.detect{|name| name == @name}
- end
+ def matches_scenario_names?(scenario_name_regexps)
+ scenario_name_regexps.detect{|name| name =~ @name}
+ end
def backtrace_line(name = "#{@keyword} #{@name}", line = @line)
@feature.backtrace_line(name, line) if @feature
end
@@ -43,9 +45,9 @@
def max_line_length
@steps.max_line_length(self)
end
def accept_hook?(hook)
- @tags.accept_hook?(hook)
+ @tags.accept_hook?(hook) || @feature.accept_hook?(hook)
end
end
end