Permalink
Browse files

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 930f7d6f2f31a43e919c00a6287748ccfc40f7dc @nicksieger nicksieger committed Nov 22, 2007
Showing with 34 additions and 1 deletion.
  1. +34 −1 acceptance/verification_spec.rb
@@ -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

0 comments on commit 930f7d6

Please sign in to comment.