<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,4 +1,5 @@
 require 'mocha/integration/mini_test/assertion_counter'
+require 'mocha/expectation_error'
 
 module Mocha
   
@@ -6,6 +7,13 @@ module Mocha
     
     module MiniTest
       
+      def self.translate(exception)
+        return exception unless exception.kind_of?(::Mocha::ExpectationError)
+        translated_exception = ::MiniTest::Assertion.new(exception.message)
+        translated_exception.set_backtrace(exception.backtrace)
+        translated_exception
+      end
+      
       module Version131AndAbove
         def run runner
           assertion_counter = AssertionCounter.new(self)
@@ -19,12 +27,12 @@ module Mocha
               @passed = true
             rescue Exception =&gt; e
               @passed = false
-              result = runner.puke(self.class, self.name, e)
+              result = runner.puke(self.class, self.name, Mocha::Integration::MiniTest.translate(e))
             ensure
               begin
                 self.teardown
               rescue Exception =&gt; e
-                result = runner.puke(self.class, self.name, e)
+                result = runner.puke(self.class, self.name, Mocha::Integration::MiniTest.translate(e))
               end
             end
           ensure</diff>
      <filename>lib/mocha/integration/mini_test/version_131_and_above.rb</filename>
    </modified>
    <modified>
      <diff>@@ -67,14 +67,16 @@ if defined?(MiniTest)
     def test_should_pass_mocha_test
       runner.run(%w(-n test_mocha_with_fulfilled_expectation))
     
+      assert_equal 0, runner.failures
       assert_equal 0, runner.errors
       assert_equal 1, runner.assertion_count
     end
 
     def test_should_fail_mocha_test_due_to_unfulfilled_expectation
       runner.run(%w(-n test_mocha_with_unfulfilled_expectation))
-    
-      assert_equal 1, runner.errors
+      
+      assert_equal 1, runner.failures
+      assert_equal 0, runner.errors
       assert_equal 1, runner.assertion_count
       assert_not_all_expectation_were_satisfied
     end
@@ -82,7 +84,8 @@ if defined?(MiniTest)
     def test_should_fail_mocha_test_due_to_unexpected_invocation
       runner.run(%w(-n test_mocha_with_unexpected_invocation))
     
-      assert_equal 1, runner.errors
+      assert_equal 1, runner.failures
+      assert_equal 0, runner.errors
       assert_equal 0, runner.assertion_count
       assert_unexpected_invocation
     end
@@ -90,6 +93,7 @@ if defined?(MiniTest)
     def test_should_pass_stubba_test
       runner.run(%w(-n test_stubba_with_fulfilled_expectation))
     
+      assert_equal 0, runner.failures
       assert_equal 0, runner.errors
       assert_equal 1, runner.assertion_count
     end
@@ -97,7 +101,8 @@ if defined?(MiniTest)
     def test_should_fail_stubba_test_due_to_unfulfilled_expectation
       runner.run(%w(-n test_stubba_with_unfulfilled_expectation))
     
-      assert_equal 1, runner.errors
+      assert_equal 1, runner.failures
+      assert_equal 0, runner.errors
       assert_equal 1, runner.assertion_count
       assert_not_all_expectation_were_satisfied
     end
@@ -105,14 +110,17 @@ if defined?(MiniTest)
     def test_should_pass_mocha_test_with_matching_parameter
       runner.run(%w(-n test_mocha_with_matching_parameter))
     
+      assert_equal 0, runner.failures
       assert_equal 0, runner.errors
       assert_equal 1, runner.assertion_count
     end
   
     def test_should_fail_mocha_test_with_non_matching_parameter
       runner.run(%w(-n test_mocha_with_non_matching_parameter))
-    
-      assert_equal 1, runner.errors
+      
+      assert_equal 1, runner.failures
+      assert_equal 0, runner.errors
+      assert_equal 0, runner.assertion_count # unexpected invocation occurs before expectation is verified
       assert_unexpected_invocation
     end
   </diff>
      <filename>test/acceptance/minitest_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>c98aad3e766664e97705447ace14623b5cddc619</id>
    </parent>
  </parents>
  <author>
    <name>James Mead</name>
    <email>james@floehopper.org</email>
  </author>
  <url>http://github.com/floehopper/mocha/commit/ad6ed8e7f1180bcc803e7bff2f28a0f81ad3b928</url>
  <id>ad6ed8e7f1180bcc803e7bff2f28a0f81ad3b928</id>
  <committed-date>2009-03-05T07:03:08-08:00</committed-date>
  <authored-date>2009-03-05T07:03:08-08:00</authored-date>
  <message>Fixed bug: MiniTest integration was counting ExpectationErrors as errors not failures. http://floehopper.lighthouseapp.com/projects/22289-mocha/tickets/41.</message>
  <tree>59f91402fda6e68d19dc0db84126a080292d8656</tree>
  <committer>
    <name>James Mead</name>
    <email>james@floehopper.org</email>
  </committer>
</commit>
