Skip to content

Commit

Permalink
Merge 4fd01ff into 09b0ae4
Browse files Browse the repository at this point in the history
  • Loading branch information
pdswan committed May 20, 2015
2 parents 09b0ae4 + 4fd01ff commit ace7e65
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions features/docs/formatters/html_formatter.feature
Expand Up @@ -88,3 +88,4 @@ Feature: HTML output formatter
"""
makeRed('background_0')
"""

1 change: 1 addition & 0 deletions lib/cucumber/formatter/legacy_api/ast.rb
Expand Up @@ -60,6 +60,7 @@ def accept(formatter)
comments.each do |comment|
formatter.comment_line comment.to_s.strip
end
formatter.after_comment comments
end
end

Expand Down
15 changes: 11 additions & 4 deletions spec/cucumber/formatter/html_spec.rb
Expand Up @@ -40,7 +40,7 @@ module Formatter

describe "with a step that embeds a snapshot" do
define_steps do
Given(/snap/) {
Given(/snap/) {
RSpec::Mocks.allow_message(File, :file?) { true }
embed('out/snapshot.jpeg', 'image/jpeg')
}
Expand Down Expand Up @@ -87,7 +87,14 @@ module Formatter

it { expect(@out.string).to match(/^\<!DOCTYPE/) }
it { expect(@out.string).to match(/\<\/html\>$/) }
it { expect(@doc).to have_css_node('.feature .comment', /Healthy/) }

it "nests the comment within the feature" do
expect(@doc).to have_css_node('.feature .comment', /Healthy/)
end

it "properly closes the comment" do
expect(@out.string).to match(%r{<pre class="comment"># Healthy<br/></pre>})
end
end

describe "with a tag" do
Expand Down Expand Up @@ -315,7 +322,7 @@ module Formatter

describe "with a step that embeds a snapshot" do
define_steps do
Given(/snap/) {
Given(/snap/) {
RSpec::Mocks.allow_message(File, :file?) { true }
embed('snapshot.jpeg', 'image/jpeg')
}
Expand All @@ -329,7 +336,7 @@ module Formatter

it { expect(@doc.css('.embed img').first.attributes['src'].to_s).to eq "snapshot.jpeg" }
end

describe "with a step that embeds a text" do
define_steps do
Given(/log/) { embed('log.txt', 'text/plain') }
Expand Down

0 comments on commit ace7e65

Please sign in to comment.