This repository has been archived by the owner on Jan 9, 2019. It is now read-only.
forked from ci-reporter/ci_reporter
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add three acceptance tests for Test::Unit, and one TODO for RSpec
git-svn-id: http://svn.caldersphere.net/svn/main/rubyforge/ci_reporter/trunk@176 b03c2d0b-2f10-0410-a2f9-fc8001506dfa
- Loading branch information
1 parent
6da80dc
commit 930f7d6
Showing
1 changed file
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,40 @@ | ||
require 'rexml/document' | ||
|
||
REPORTS_DIR = File.dirname(__FILE__) + '/reports' | ||
|
||
describe "Test::Unit acceptance" do | ||
it "should generate two XML files" do | ||
violated "to complete" | ||
File.exist?(File.join(REPORTS_DIR, 'TEST-TestUnitExampleTestOne.xml')).should == true | ||
File.exist?(File.join(REPORTS_DIR, 'TEST-TestUnitExampleTestTwo.xml')).should == true | ||
end | ||
|
||
it "should have one error and one failure for TestUnitExampleTestOne" do | ||
doc = File.open(File.join(REPORTS_DIR, 'TEST-TestUnitExampleTestOne.xml')) do |f| | ||
REXML::Document.new(f) | ||
end | ||
doc.root.attributes["errors"].should == "1" | ||
doc.root.attributes["failures"].should == "1" | ||
doc.root.attributes["assertions"].should == "1" | ||
doc.root.attributes["tests"].should == "1" | ||
failures = doc.root.elements.to_a("/testsuite/testcase/failure") | ||
failures.size.should == 2 | ||
end | ||
|
||
it "should have no errors or failures for TestUnitExampleTestTwo" do | ||
doc = File.open(File.join(REPORTS_DIR, 'TEST-TestUnitExampleTestTwo.xml')) do |f| | ||
REXML::Document.new(f) | ||
end | ||
doc.root.attributes["errors"].should == "0" | ||
doc.root.attributes["failures"].should == "0" | ||
doc.root.attributes["assertions"].should == "1" | ||
doc.root.attributes["tests"].should == "1" | ||
failures = doc.root.elements.to_a("/testsuite/testcase/failure") | ||
failures.size.should == 0 | ||
end | ||
end | ||
|
||
describe "RSpec acceptance" do | ||
it "should generate one XML file" do | ||
violated "TODO" | ||
end | ||
end |