spec/cucumber/formatter/junit_spec.rb in cucumber-0.8.5 vs spec/cucumber/formatter/junit_spec.rb in cucumber-0.8.6
- old
+ new
@@ -1,7 +1,7 @@
-require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
-require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
+require 'spec_helper'
+require 'cucumber/formatter/spec_helper'
require 'cucumber/formatter/junit'
require 'nokogiri'
module Cucumber::Formatter
@@ -49,10 +49,23 @@
Given a passing scenario
FEATURE
it { @doc.to_s.should =~ /One passing scenario, one failing scenario/ }
end
+
+ describe "with a scenario in a subdirectory" do
+ define_feature %{
+ Feature: One passing scenario, one failing scenario
+
+ Scenario: Passing
+ Given a passing scenario
+ }, 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')
+ end
+ end
describe "with a scenario outline table" do
define_steps do
Given(/.*/) { }
end
@@ -79,9 +92,10 @@
it { @doc.to_s.should =~ /Cucumber/ }
it { @doc.to_s.should =~ /Whisky/ }
it { @doc.to_s.should =~ /Big Mac/ }
it { @doc.to_s.should_not =~ /Things/ }
it { @doc.to_s.should_not =~ /Good|Evil/ }
+ it { @doc.to_s.should_not =~ /type="skipped"/}
end
describe "with a regular data table scenario" do
define_steps do
Given(/the following items on a shortlist/) { |table| }
\ No newline at end of file