Skip to content

Commit

Permalink
Show backgrounds
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenny Gilles authored and norekinc committed May 26, 2016
1 parent 72796f2 commit 23f5220
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions lib/cucumber/city_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ def feature(feature)

feature[:tags].each {|feature_tag| find_or_create_tag(feature_tag[:name],f) }
end
background(feature[:background]) if feature[:background]
feature[:scenarioDefinitions].each { |s|
case s[:type]
when :ScenarioOutline
Expand All @@ -113,21 +114,24 @@ def feature(feature)
#
# Called when a background has been found
#
# @see #scenario
# @see #feature
def background(background)
#log.debug "BACKGROUND"

@background = YARD::CodeObjects::Cucumber::Scenario.new(@feature,"background") do |b|
b.comments = background.comments.map{|comment| comment.value}.join("\n")
b.comments = background[:comments] ? background[:comments].map{|comment| comment.value}.join("\n") : ''
b.description = background[:description] || ''
b.keyword = background.keyword
b.value = background.name
b.add_file(@file,background.line)
b.keyword = background[:keyword]
b.value = background[:name]
b.add_file(@file,background[:location][:line])
end

@feature.background = @background
@background.feature = @feature
@step_container = @background
background[:steps].each { |s|
step(s)
}
end

#
Expand Down

0 comments on commit 23f5220

Please sign in to comment.