Permalink
Browse files

Fix junit formatter problems on Windows. Closes #81. Closes #86.

  • Loading branch information...
aslakhellesoy committed Jul 10, 2011
1 parent f3a6bd5 commit 7f6030bc362f00867479ae92b63c20ab008f83fc
View
@@ -3,6 +3,7 @@
### Bugfixes
* Removed extra colons emitted by rerun formatter ([#99](https://github.com/cucumber/cucumber/pull/99) Juan Manuel Barreneche)
* cucumber 1.0.0 wrong number of arguments error when generating json format on jruby for windows ([#97](https://github.com/cucumber/cucumber/issues/97) (Aslak Hellesøy)
+* Recent change to junit.rb breaks on Windows ([#81](https://github.com/cucumber/cucumber/issues/81), [#86](https://github.com/cucumber/cucumber/pull/86) Johnlon, Aslak Hellesøy)
### New Features
* If the CUCUMBER_TRUNCATE_OUTPUT environment variable is set, lines will be truncated. Used by the Cucumber book. (Aslak Hellesøy)
@@ -12,7 +12,7 @@ Feature: JUnit output formatter
"""
"""
- And "fixtures/junit/tmp/TEST-one_passing_one_failing.xml" with junit duration "0.005" should contain
+ And "fixtures/junit/tmp/TEST-features-one_passing_one_failing.xml" with junit duration "0.005" should contain
"""
<?xml version="1.0" encoding="UTF-8"?>
<testsuite errors="0" failures="1" name="One passing scenario, one failing scenario" skipped="0" tests="2" time="0.005">
@@ -40,7 +40,7 @@ Feature: JUnit output formatter
"""
"""
- And "fixtures/junit/tmp/TEST-some_subdirectory_one_passing_one_failing.xml" with junit duration "0.005" should contain
+ And "fixtures/junit/tmp/TEST-features-some_subdirectory-one_passing_one_failing.xml" with junit duration "0.005" should contain
"""
<?xml version="1.0" encoding="UTF-8"?>
<testsuite errors="0" failures="1" name="Subdirectory - One passing scenario, one failing scenario" skipped="0" tests="2" time="0.005">
@@ -68,7 +68,7 @@ Feature: JUnit output formatter
"""
"""
- And "fixtures/junit/tmp/TEST-pending.xml" with junit duration "0.009" should contain
+ And "fixtures/junit/tmp/TEST-features-pending.xml" with junit duration "0.009" should contain
"""
<?xml version="1.0" encoding="UTF-8"?>
<testsuite errors="0" failures="0" name="Pending step" skipped="2" tests="2" time="0.009">
@@ -88,7 +88,7 @@ Feature: JUnit output formatter
"""
"""
- And "fixtures/junit/tmp/TEST-pending.xml" with junit duration "0.000160" should contain
+ And "fixtures/junit/tmp/TEST-features-pending.xml" with junit duration "0.000160" should contain
"""
<?xml version="1.0" encoding="UTF-8"?>
<testsuite errors="0" failures="2" name="Pending step" skipped="0" tests="2" time="0.000160">
@@ -120,8 +120,8 @@ Feature: JUnit output formatter
"""
"""
- And "fixtures/junit/tmp/TEST-one_passing_one_failing.xml" should exist
- And "fixtures/junit/tmp/TEST-pending.xml" should exist
+ And "fixtures/junit/tmp/TEST-features-one_passing_one_failing.xml" should exist
+ And "fixtures/junit/tmp/TEST-features-pending.xml" should exist
Scenario: show correct error message if no --out is passed
When I run cucumber --format junit features
@@ -140,7 +140,7 @@ You \*must\* specify \-\-out DIR for the junit formatter
"""
"""
- And "fixtures/junit/tmp/TEST-scenario_outline.xml" with junit duration "0.005" should contain
+ And "fixtures/junit/tmp/TEST-features-scenario_outline.xml" with junit duration "0.005" should contain
"""
<?xml version="1.0" encoding="UTF-8"?>
<testsuite errors="0" failures="1" name="Scenario outlines" skipped="0" tests="2" time="0.005">
@@ -144,8 +144,7 @@ def feature_result_filename(feature_file)
end
def basename(feature_file)
- ext_length = File.extname(feature_file).length
- feature_file.gsub('features/', '').gsub(File::SEPARATOR, '_')[0...-ext_length]
+ File.basename(feature_file.gsub(/[\\\/]/, '-'), '.feature')
end
def write_file(feature_filename, data)
@@ -61,7 +61,7 @@ def write_file(feature_filename, data)
}, File.join('features', 'some', 'path', 'spec.feature')
it 'writes the filename including the subdirectory' do
- @formatter.written_files.keys.first.should == File.join('', 'TEST-some_path_spec.xml')
+ @formatter.written_files.keys.first.should == File.join('', 'TEST-features-some-path-spec.xml')
end
end

0 comments on commit 7f6030b

Please sign in to comment.