Class: YARD::CodeObjects::Cucumber::Tag

Inherits:
NamespaceObject show all
Defined in:
lib/yard/code_objects/cucumber/tag.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from LocationHelper

#file, #line_number, #location

Instance Attribute Details

#ownersObject

Returns the value of attribute owners.



4
5
6
# File 'lib/yard/code_objects/cucumber/tag.rb', line 4

def owners
  @owners
end

#total_scenariosObject

Returns the value of attribute total_scenarios.



4
5
6
# File 'lib/yard/code_objects/cucumber/tag.rb', line 4

def total_scenarios
  @total_scenarios
end

#valueObject

Returns the value of attribute value.



4
5
6
# File 'lib/yard/code_objects/cucumber/tag.rb', line 4

def value
  @value
end

Instance Method Details

#all_scenariosObject



27
28
29
# File 'lib/yard/code_objects/cucumber/tag.rb', line 27

def all_scenarios
  scenarios + indirect_scenarios
end

#featuresObject



6
7
8
# File 'lib/yard/code_objects/cucumber/tag.rb', line 6

def features
  @owners.find_all { |owner| owner.is_a?(Feature) }
end

#indirect_scenariosObject



23
24
25
# File 'lib/yard/code_objects/cucumber/tag.rb', line 23

def indirect_scenarios
  @owners.find_all { |owner| owner.is_a?(Feature) }.collect { |feature| feature.scenarios }.flatten
end

#scenariosObject



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/yard/code_objects/cucumber/tag.rb', line 10

def scenarios
  all = @owners.find_all do |owner|
    owner.is_a?(Scenario) || owner.is_a?(ScenarioOutline) || ()
  end

  @owners.each do |owner|
    if owner.is_a?(ScenarioOutline::Examples) && !all.include?(owner.scenario)
      all << owner.scenario
    end
  end
  all
end