Skip to content

Commit

Permalink
Merge pull request #1111 from akostadinov/master
Browse files Browse the repository at this point in the history
use absolute path to avoid chdir issues
  • Loading branch information
danascheider committed Sep 22, 2017
2 parents b3b7da5 + 900fa7d commit b9d73b9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/cucumber/formatter/io.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def ensure_dir(path, name)
raise "You *must* specify --out DIR for the #{name} formatter" unless String === path
raise "I can't write #{name} reports to a file - it has to be a directory" if File.file?(path)
FileUtils.mkdir_p(path) unless File.directory?(path)
path
File.absolute_path path
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/cucumber/formatter/junit_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ def after_step(step)
Given a passing scenario
}, File.join('features', 'some', 'path', 'spec.feature')

it 'writes the filename including the subdirectory' do
expect(@formatter.written_files.keys.first).to eq File.join('', 'TEST-features-some-path-spec.xml')
it 'writes the filename with absolute path' do
expect(@formatter.written_files.keys.first).to eq File.absolute_path('TEST-features-some-path-spec.xml')
end
end

Expand Down

0 comments on commit b9d73b9

Please sign in to comment.