<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,22 +1,14 @@
-PROBLEM
-=======
-To run a single test / single spec you need to
-
- - know test/spec commandline interface
- - remember where a file is
- - type the full path
- - set the correct options (color/...)
-
+Runs a single test/spec via rake.
 
 USAGE
 =====
     script/plugin install git://github.com/grosser/single_test.git
 
 ###Single test/spec
-    rake spec:user          #run spec/model/user_spec.rb (search for user*_spec.rb)
+    rake spec:user          #run spec/model/user_spec.rb (searches for user*_spec.rb)
     rake test:users_c       #run test/functional/users_controller_test.rb
     rake spec:admin/users_c #run spec/controllers/admin/users_controller_spec.rb
-    rake test:u*hel         #run test/helpers/user_helper_test.rb (seach for u*hel*_test.rb)
+    rake test:u*hel         #run test/helpers/user_helper_test.rb (searches for u*hel*_test.rb)
 
 ###Single test-case/example
     rake spec:user:token    #run the first spec in user_spec.rb that matches /token/
@@ -29,6 +21,13 @@ USAGE
     rake spec:one_by_one    #run each spec/test one by one, to find tests that fail when ran
     rake test:one_by_one    #on their own or produce strange output
 
+###For last mofified file
+    rake test:last
+    rake spec:last
+
+TODO
+====
+ - make test:last more clever e.g. lib -&gt; try spec + spec/lib
 
 AUTHOR
 ======</diff>
      <filename>README.markdown</filename>
    </modified>
    <modified>
      <diff>@@ -6,6 +6,16 @@ module SingleTest
     'spec'=&gt; %w(models controllers views helpers *),
   }
 
+  def run_last(type)
+    last = last_modified_file('app',:ext=&gt;'.rb')
+    test = last.sub('app',type).sub('.rb',&quot;_#{type}.rb&quot;)
+    if File.exist?(test)
+      run_test(type, test)
+    else
+      puts &quot;could not find #{test}&quot;
+    end
+  end
+
   def run_one_by_one(type)
     tests = FileList[&quot;#{RAILS_ROOT}/#{type}/**/*_#{type}.rb&quot;].reject{|file|File.directory?(file)}
     puts &quot;Running #{tests.size} #{type}s&quot;
@@ -71,4 +81,8 @@ module SingleTest
     else raise &quot;Unknown: #{type}&quot;
     end
   end
+
+  def last_modified_file(dir, options={})
+    Dir[&quot;#{dir}/**/*#{options[:ext]}&quot;].sort_by { |p| File.mtime(p) }.last
+  end
 end
\ No newline at end of file</diff>
      <filename>lib/single_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -11,23 +11,11 @@ end
       require File.join(File.dirname(__FILE__),'..','lib','single_test')
       SingleTest.run_one_by_one(type)
     end
-  end
-end
 
-#TODO make more generic / use for test / add to readme
-namespace :spec do
-  desc &quot;run test for last modified file in app folder&quot;
-  task :last do
-    def last_modified_file(dir, options={})
-      Dir[&quot;#{dir}/**/*#{options[:ext]}&quot;].sort_by { |p| File.mtime(p) }.last
-    end
-    
-    last = last_modified_file('app',:ext=&gt;'.rb')
-    spec = last.sub('app','spec').sub('.rb','_spec.rb')
-    if File.exist?(spec)
-      sh &quot;script/spec -O spec/spec.opts #{spec}&quot;
-    else
-      puts &quot;could not find #{spec}&quot;
+    desc &quot;run #{type} for last modified file in app folder&quot;
+    task :last do
+      require File.join(File.dirname(__FILE__),'..','lib','single_test')
+      SingleTest.run_last(type)
     end
   end
 end
\ No newline at end of file</diff>
      <filename>tasks/single_test.rake</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>641d52a1aab485f0da43a3a4f7d0ac18e7615105</id>
    </parent>
  </parents>
  <author>
    <name>grosser</name>
    <email>grosser.michael@gmail.com</email>
  </author>
  <url>http://github.com/grosser/single_test/commit/acacbaa19c3eed95af9ffbe7f4ce654c73617e77</url>
  <id>acacbaa19c3eed95af9ffbe7f4ce654c73617e77</id>
  <committed-date>2009-09-17T08:42:20-07:00</committed-date>
  <authored-date>2009-09-17T08:42:20-07:00</authored-date>
  <message>added spec/test:last simplified readme</message>
  <tree>6aece2564e9ab7e4d1416691cc6fbe1788434ae0</tree>
  <committer>
    <name>grosser</name>
    <email>grosser.michael@gmail.com</email>
  </committer>
</commit>
