all_locations()
click to toggle source
def all_locations
@all_locations ||= Ast::Location.merge(all_source.map(&:all_locations).flatten)
end
all_source()
click to toggle source
def all_source
@all_source ||= (source + test_steps.map(&:source)).flatten.uniq
end
describe_source_to(visitor, *args)
click to toggle source
def describe_source_to(visitor, *args)
source.reverse.each do |node|
node.describe_to(visitor, *args)
end
self
end
describe_to(visitor, *args)
click to toggle source
def describe_to(visitor, *args)
visitor.test_case(self, *args) do |child_visitor|
compose_around_hooks(child_visitor, *args) do
test_steps.each do |test_step|
test_step.describe_to(child_visitor, *args)
end
end
end
self
end
feature()
click to toggle source
def feature
source.first
end
inspect()
click to toggle source
def inspect
"#<#{self.class}: #{location}>"
end
keyword()
click to toggle source
def keyword
@keyword ||= NameBuilder.new(self).keyword
end
language()
click to toggle source
def language
feature.language
end
location()
click to toggle source
def location
source.last.location
end
match_locations?(queried_locations)
click to toggle source
def match_locations?(queried_locations)
queried_locations.any? { |queried_location|
all_source.any? { |node|
node.all_locations.any? { |location|
queried_location.match? location
}
}
}
end
match_name?(name_regexp)
click to toggle source
def match_name?(name_regexp)
source.any? { |node| node.respond_to?(:name) && node.name =~ name_regexp }
end
name()
click to toggle source
def name
@name ||= NameBuilder.new(self).result
end
step_count()
click to toggle source
def step_count
test_steps.count
end
with_around_hooks(around_hooks)
click to toggle source
def with_around_hooks(around_hooks)
self.class.new(test_steps, source, around_hooks)
end
with_steps(test_steps)
click to toggle source
def with_steps(test_steps)
self.class.new(test_steps, source, around_hooks)
end