Skip to content

Commit

Permalink
Add test for handling captured output encodings in junit
Browse files Browse the repository at this point in the history
  • Loading branch information
NickAb committed Jan 15, 2018
1 parent 550814c commit 0a208e8
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions spec/cucumber/formatter/junit_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,29 @@ def write_file(feature_filename, data)
it { expect(@doc.xpath('//testsuite/testcase/system-out').first.content).to match(/\s+boo boo\s+/) }
end

describe 'is able to handle multiple encodings in pipe' do
before(:each) do
run_defined_feature
@doc = Nokogiri.XML(@formatter.written_files.values.first)
end

define_steps do
Given(/a passing ctrl scenario/) do
Kernel.puts "encoding"
Kernel.puts "pickle".encode("UTF-16")
end
end

define_feature "
Feature: One passing scenario, one failing scenario
Scenario: Passing
Given a passing ctrl scenario
"

it { expect(@doc.xpath('//testsuite/testcase/system-out').first.content).to match(/\s+encoding\npickle\s+/) }
end

describe 'a feature with no name' do
define_feature <<-FEATURE
Feature:
Expand Down

0 comments on commit 0a208e8

Please sign in to comment.