<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/context/shared_behavior.rb</filename>
    </added>
    <added>
      <filename>test/test_shared.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -46,6 +46,12 @@ If you've ever wanted contexts in your Test::Unit tests, then context is for you
 * It also has aliases that match other library's syntaxes (all of which can be mixed and matched):
 
       class UserTest &lt; Test::Unit::TestCase
+        context &quot;A new Account&quot; do
+          test &quot;should be new&quot; do
+            Account.new.new_record?
+          end
+        end
+        
         # RSpec-esque
         describe &quot;A new User&quot; do
           it &quot;should do things&quot; do
@@ -79,6 +85,42 @@ If you've ever wanted contexts in your Test::Unit tests, then context is for you
       end
     end
 
+* You can also share behavior among contexts:
+
+    class UserTest &lt; Test::Unit::TestCase
+      shared &quot;shared things&quot; do
+        test &quot;things are shared&quot; do
+          # test logic here...
+        end
+      end
+      
+      context &quot;the first thing&quot; do
+        uses &quot;shared things&quot;
+        
+        test &quot;other things...&quot; do
+          # More testing...
+        end
+      end
+    end
+
+* Shared behaviors can also use RSpec syntax
+
+    class UserTest &lt; Test::Unit::TestCase
+      share_examples_for &quot;shared things&quot; do
+        it &quot;things are shared&quot; do
+          # test logic here...
+        end
+      end
+  
+      describe &quot;the first thing&quot; do
+        it_should_behave_like &quot;shared things&quot;
+    
+        it &quot;other things...&quot; do
+          # More testing...
+        end
+      end
+    end
+
 == REQUIREMENTS:
 
 * Test::Unit (you have it; trust me)</diff>
      <filename>README.rdoc</filename>
    </modified>
    <modified>
      <diff>@@ -10,3 +10,4 @@ require 'context/suite'
 require 'context/test'
 require 'context/lifecycle'
 require 'context/context'
+require 'context/shared_behavior'
\ No newline at end of file</diff>
      <filename>lib/context.rb</filename>
    </modified>
    <modified>
      <diff>@@ -41,6 +41,7 @@ class Test::Unit::TestCase
     def context(name, &amp;block)
       cls = Class.new(self)
       cls.context_name = name
+      puts &quot;Creating context #{cls.context_name}&quot;
       cls.class_eval(&amp;block)
       
       cls</diff>
      <filename>lib/context/context.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,4 +3,9 @@ class String
   def to_method_name
     self.downcase.gsub(/\s+/,'_')
   end
+  
+  # Borrowed from +camelize+ in ActiveSupport
+  def to_module_name
+    self.to_method_name.gsub(/\/(.?)/) { &quot;::#{$1.upcase}&quot; }.gsub(/(?:^|_)(.)/) { $1.upcase }
+  end
 end
\ No newline at end of file</diff>
      <filename>lib/context/core_ext/string.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,6 +4,7 @@ class Test::Unit::TestCase
     # get weird default tests
     def suite # :nodoc:
       method_names = public_instance_methods(false)
+
       tests = method_names.delete_if {|method_name| method_name !~ /^test./}
       suite = Test::Unit::TestSuite.new(name)
       </diff>
      <filename>lib/context/suite.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,7 +9,7 @@ class Test::Unit::TestCase
     #
     def test(name, &amp;block)
       test_name = &quot;test_#{((context_name == &quot;&quot; ? context_name : context_name + &quot; &quot;) + name).to_method_name}&quot;.to_sym
-      
+      puts &quot;running test #{test_name}&quot;
       defined = instance_method(test_name) rescue false
       raise &quot;#{test_name} is already defined in #{self}&quot; if defined
       </diff>
      <filename>lib/context/test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>5ccf0b3f08d63d955003750489319457073bab98</id>
    </parent>
  </parents>
  <author>
    <name>Jeremy McAnally</name>
    <email>jeremymcanally@gmail.com</email>
  </author>
  <url>http://github.com/jeremymcanally/context/commit/23b60b58f8d8b71dcb7dfe6a9e618d5540b8df12</url>
  <id>23b60b58f8d8b71dcb7dfe6a9e618d5540b8df12</id>
  <committed-date>2008-10-10T01:15:05-07:00</committed-date>
  <authored-date>2008-10-10T01:15:05-07:00</authored-date>
  <message>Shared behaviors.  Still trying to figure out why TestTask hates me.</message>
  <tree>50e91b1fbf9ef0f4d6e5aa50b177e232f4014380</tree>
  <committer>
    <name>Jeremy McAnally</name>
    <email>jeremymcanally@gmail.com</email>
  </committer>
</commit>
