Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use absolute path to avoid chdir issues #1111

Merged
merged 1 commit into from
Sep 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/cucumber/formatter/io.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,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 @@ -117,8 +117,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