Module: Turnip::Node::HasTags

Included in:
Example, Feature, Scenario, ScenarioOutline
Defined in:
lib/turnip/node/tag.rb

Instance Method Summary collapse

Instance Method Details

#metadata_hashHash

Convert for hash to be used in RSpec

Returns:

  • (Hash)


42
43
44
# File 'lib/turnip/node/tag.rb', line 42

def 
  Hash[tags.map { |t| [t.name.to_sym, true] }]
end

#tag_namesArray

Returns Array of tag name.

Returns:

  • (Array)

    Array of tag name



33
34
35
# File 'lib/turnip/node/tag.rb', line 33

def tag_names
  tags.map(&:name)
end

#tagsArray

Returns Array of Tag.

Returns:

  • (Array)

    Array of Tag



24
25
26
27
28
# File 'lib/turnip/node/tag.rb', line 24

def tags
  @tags ||= @raw.fetch(:tags, []).map do |tag|
    Tag.new(tag)
  end
end