<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>test/unit/test_case_switching_test.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -6,6 +6,15 @@ module Drunit
     def RemoteApp(name, *args)
       const_set &quot;RemoteAppFor_#{name}&quot;, RemoteApp.new(name, *args)
     end
+
+    def drunit_test_case_class_name
+      @drunit_test_case_class_name ||
+        (superclass.respond_to?(:drunit_test_case_class_name) ? superclass.drunit_test_case_class_name : &quot;Test::Unit::TestCase&quot;)
+    end
+
+    def set_drunit_test_case_class_name(name)
+      @drunit_test_case_class_name = name
+    end
   end
 
   def in_app(name, *args, &amp;block)
@@ -42,7 +51,15 @@ private
 
   def remote_test_case_for(name)
     @remote_test_cases ||= {}
-    @remote_test_cases[name.to_sym] ||= remote_app_for(name).new_test_case
+    @remote_test_cases[name.to_sym] ||= remote_app_for(name).new_test_case(drunit_test_case_class_name)
+  end
+
+  def set_drunit_test_case_class_name(name)
+    @drunit_test_case_class_name = name
+  end
+
+  def drunit_test_case_class_name
+    @drunit_test_case_class_name || self.class.drunit_test_case_class_name
   end
 
   def caller_file_and_method_for_block(&amp;block)</diff>
      <filename>lib/drunit.rb</filename>
    </modified>
    <modified>
      <diff>@@ -11,8 +11,8 @@ module Drunit
       @remote_object = nil
     end
 
-    def new_test_case
-      app.new_test_case
+    def new_test_case(class_name = &quot;Test::Unit::TestCase&quot;)
+      app.new_test_case(class_name)
     end
 
   private</diff>
      <filename>lib/drunit/remote_app.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,14 +4,19 @@ require File.join(File.dirname(__FILE__), *%w[remote_error])
 
 module Drunit
   class RemoteTest
-    def new_test_case
-      TestCase.new
+    def new_test_case(name)
+      tc = Class.new(eval(name, Object.class_eval{ binding }))
+      tc.send(:include, TestCaseModule)
+      tc.allocate
     end
 
-    class TestCase
-      include DRb::DRbUndumped
-      include Test::Unit::Assertions
-      attr_reader :assertion_count
+    module TestCaseModule
+      def self.included(other)
+        other.send(:class_eval) do
+          include DRb::DRbUndumped
+          attr_reader :assertion_count
+        end
+      end
 
       def initialize
         @assertion_count = 0</diff>
      <filename>lib/drunit/remote_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,6 +7,12 @@ end
 class SomeException &lt; Exception
 end
 
+class SomeOtherTestCase
+  def assert_in_new_test_case
+    add_assertion
+  end
+end
+
 module MyModule
   class SomeOtherException &lt; Exception
   end</diff>
      <filename>test/fake_app/fake_app.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>60c3a3327907e8a43e815701280aeeaa77eea739</id>
    </parent>
  </parents>
  <author>
    <name>Tom Lea</name>
    <email>commit@tomlea.co.uk</email>
  </author>
  <url>http://github.com/cwninja/drunit/commit/3a1d8c332477d1830eea302078c1ea365d097929</url>
  <id>3a1d8c332477d1830eea302078c1ea365d097929</id>
  <committed-date>2009-06-08T05:58:34-07:00</committed-date>
  <authored-date>2009-06-08T05:58:34-07:00</authored-date>
  <message>Added support for swappable remote test classes. We should be able to test with a ActionController::TestCase if we want to.</message>
  <tree>f028fdf90f2c6d79711409a5df47b2d6eb516d87</tree>
  <committer>
    <name>Tom Lea</name>
    <email>commit@tomlea.co.uk</email>
  </committer>
</commit>
