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

Recent change to junit.rb breaks on Windows #81

Closed
Johnlon opened this issue Jun 7, 2011 · 8 comments
Closed

Recent change to junit.rb breaks on Windows #81

Johnlon opened this issue Jun 7, 2011 · 8 comments

Comments

@Johnlon
Copy link
Member

Johnlon commented Jun 7, 2011

The recent update to the junit formatter only works on Unix.
The change hard coded / as the path separator.
On windows its \
Result is that junit.rb fails to find the relative path of the feature files relative to the features/ directory.
And it also fails to substitute all remaining path separators for underscore.
This in turn causes it to fail to create output XML file on Windows XML.

At least one fix is this ...

def basename(feature_file)
ext_length = File.extname(feature_file).length
# get the path rel to the features/ dir
rel_path = Pathname.new(feature_file).relative_path_from(Pathname.new("features"))
# substitute all remaining path separators (windows and *nix) for underscore
(""+rel_path).gsub(/[\/]/, '_')[0...-ext_length]
end

@Johnlon
Copy link
Member Author

Johnlon commented Jun 7, 2011

Sorry "Windows XML" should have been "Windows XP and Win 7"

@Johnlon
Copy link
Member Author

Johnlon commented Jun 7, 2011

I have no idea how to use Git but I think I've made the change here ...
git@github.com:Johnlon/cucumber.git

@Johnlon Johnlon closed this as completed Jun 7, 2011
@Johnlon Johnlon reopened this Jun 7, 2011
@Johnlon
Copy link
Member Author

Johnlon commented Jun 7, 2011

Sorry didn't mean to close it - see git@github.com:Johnlon/cucumber.git

@cayblood
Copy link

cayblood commented Jun 9, 2011

I'm experiencing this too on Windows Server 2008

@underbjerg
Copy link

I also have this problem on Windows 7 and the latest cucumber 1.0.0. Sadly it breaks bamboo integration in our continuous integration environment.
For now, I've applied Johnlon's fix, but is there any chance of getting a fix merged into the main release?

@aslakhellesoy
Copy link
Contributor

I'll gladly apply a fix if I get a patch or pull request. It's a little too much work for me to figure out what @Johnlon changed. Github is full of tutorials about how to use git.

@aslakhellesoy
Copy link
Contributor

Aha - I read this again, I shoud be able to fix this with the suggestion at the top here.

@lock
Copy link

lock bot commented Oct 25, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants