Class: CucumberToHtml::Cell::Feature

Inherits:
Cucumberhtml::Cell show all
Defined in:
app/concepts/cucumber_to_html/cell/feature.rb

Instance Method Summary collapse

Instance Method Details

#activeObject



13
14
15
# File 'app/concepts/cucumber_to_html/cell/feature.rb', line 13

def active
  options[:active]
end

#descriptionObject



33
34
35
# File 'app/concepts/cucumber_to_html/cell/feature.rb', line 33

def description
  Kramdown::Document.new(model['description']).to_html
end

#element(element) ⇒ Object



41
42
43
44
45
46
47
48
49
50
51
52
# File 'app/concepts/cucumber_to_html/cell/feature.rb', line 41

def element(element)
  case element['keyword']
  when 'Scenario'
    Scenario.call(element).call
  when 'Background'
    Element.call(element).call if element == element_list[0]
  when 'Scenario Outline'
    ScenarioOutline.call(element).call
  else
    raise "Unknown element: #{element['keyword']}"
  end
end

#element_listObject



37
38
39
# File 'app/concepts/cucumber_to_html/cell/feature.rb', line 37

def element_list
  model['elements']
end

#featureObject



5
6
7
# File 'app/concepts/cucumber_to_html/cell/feature.rb', line 5

def feature
  model
end

#feature_classesObject



17
18
19
# File 'app/concepts/cucumber_to_html/cell/feature.rb', line 17

def feature_classes
  'show active' if active
end

#feature_idObject



25
26
27
# File 'app/concepts/cucumber_to_html/cell/feature.rb', line 25

def feature_id
  "list-#{model['id']}"
end

#feature_menu_itemObject



9
10
11
# File 'app/concepts/cucumber_to_html/cell/feature.rb', line 9

def feature_menu_item
  render :feature_menu_item
end


21
22
23
# File 'app/concepts/cucumber_to_html/cell/feature.rb', line 21

def menu_classes
  "list-group-item list-group-item-action #{'active' if active}"
end

#nameObject



29
30
31
# File 'app/concepts/cucumber_to_html/cell/feature.rb', line 29

def name
  model['name']
end