<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,4 +1,7 @@
 #!/usr/bin/env ruby
 require 'rspactor/runner'
 
-RSpactor::Runner.start(:coral =&gt; ARGV.include?('--coral'))
\ No newline at end of file
+RSpactor::Runner.start({
+  :coral =&gt; ARGV.delete('--coral'),
+  :run_in =&gt; ARGV.last
+})
\ No newline at end of file</diff>
      <filename>bin/rspactor</filename>
    </modified>
    <modified>
      <diff>@@ -67,9 +67,9 @@ module RSpactor
 
       candidates.map do |candidate|
         if candidate.index('spec') == 0
-          candidate
+          File.join(@root, candidate)
         else
-          'spec/' + candidate
+          File.join(@root, 'spec', candidate)
         end
       end
     end</diff>
      <filename>lib/rspactor/inspector.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,8 @@ require 'rspactor'
 module RSpactor
   class Runner
     def self.start(options = {})
-      new(Dir.pwd, options).start
+      run_in = options.delete(:run_in) || Dir.pwd
+      new(run_in, options).start
     end
     
     attr_reader :dir, :options, :inspector, :interactor
@@ -48,7 +49,7 @@ module RSpactor
     end
 
     def run_all_specs
-      run_spec_command('spec')
+      run_spec_command(File.join(dir, 'spec'))
     end
 
     def run_spec_command(paths)</diff>
      <filename>lib/rspactor/runner.rb</filename>
    </modified>
    <modified>
      <diff>@@ -11,75 +11,75 @@ describe RSpactor::Inspector do
   
   describe &quot;#translate&quot; do
     it &quot;should consider all controllers when application_controller changes&quot; do
-      translate('/project/app/controllers/application_controller.rb').should == ['spec/controllers']
-      translate('/project/app/controllers/application.rb').should == ['spec/controllers']
+      translate('/project/app/controllers/application_controller.rb').should == ['/project/spec/controllers']
+      translate('/project/app/controllers/application.rb').should == ['/project/spec/controllers']
     end
     
     it &quot;should translate files under 'app/' directory&quot; do
       translate('/project/app/controllers/foo_controller.rb').should ==
-        ['spec/controllers/foo_controller_spec.rb']
+        ['/project/spec/controllers/foo_controller_spec.rb']
     end
     
     it &quot;should translate templates&quot; do
-      translate('/project/app/views/foo/bar.erb').should == ['spec/views/foo/bar.erb_spec.rb']
+      translate('/project/app/views/foo/bar.erb').should == ['/project/spec/views/foo/bar.erb_spec.rb']
       translate('/project/app/views/foo/bar.html.haml').should ==
-        ['spec/views/foo/bar.html.haml_spec.rb', 'spec/views/foo/bar.html_spec.rb']
+        ['/project/spec/views/foo/bar.html.haml_spec.rb', '/project/spec/views/foo/bar.html_spec.rb']
     end
     
     it &quot;should consider all views when application_helper changes&quot; do
-      translate('/project/app/helpers/application_helper.rb').should == ['spec/helpers', 'spec/views']
+      translate('/project/app/helpers/application_helper.rb').should == ['/project/spec/helpers', '/project/spec/views']
     end
     
     it &quot;should consider related templates when a helper changes&quot; do
       translate('/project/app/helpers/foo_helper.rb').should ==
-        ['spec/helpers/foo_helper_spec.rb', 'spec/views/foo']
+        ['/project/spec/helpers/foo_helper_spec.rb', '/project/spec/views/foo']
     end
     
     it &quot;should translate files under deep 'lib/' directory&quot; do
       translate('/project/lib/awesum/rox.rb').should ==
-        ['spec/lib/awesum/rox_spec.rb', 'spec/awesum/rox_spec.rb', 'spec/rox_spec.rb']
+        ['/project/spec/lib/awesum/rox_spec.rb', '/project/spec/awesum/rox_spec.rb', '/project/spec/rox_spec.rb']
     end
     
     it &quot;should translate files under shallow 'lib/' directory&quot; do
-      translate('lib/runner.rb').should == ['spec/lib/runner_spec.rb', 'spec/runner_spec.rb']
+      translate('lib/runner.rb').should == ['/project/spec/lib/runner_spec.rb', '/project/spec/runner_spec.rb']
     end
     
     it &quot;should handle relative paths&quot; do
-      translate('foo.rb').should == ['spec/foo_spec.rb']
+      translate('foo.rb').should == ['/project/spec/foo_spec.rb']
     end
     
     it &quot;should handle files without extension&quot; do
-      translate('foo').should == ['spec/foo_spec.rb']
+      translate('foo').should == ['/project/spec/foo_spec.rb']
     end
     
     it &quot;should consider all controllers, helpers and views when routes.rb changes&quot; do
-      translate('config/routes.rb').should == ['spec/controllers', 'spec/helpers', 'spec/views']
+      translate('config/routes.rb').should == ['/project/spec/controllers', '/project/spec/helpers', '/project/spec/views']
     end
     
     it &quot;should consider all models when config/database.yml changes&quot; do
-      translate('config/database.yml').should == ['spec/models']
+      translate('config/database.yml').should == ['/project/spec/models']
     end
     
     it &quot;should consider all models when db/schema.rb changes&quot; do
-      translate('db/schema.rb').should == ['spec/models']
+      translate('db/schema.rb').should == ['/project/spec/models']
     end
     
     it &quot;should consider related model when its observer changes&quot; do
-      translate('app/models/user_observer.rb').should == ['spec/models/user_observer_spec.rb', 'spec/models/user_spec.rb']
+      translate('app/models/user_observer.rb').should == ['/project/spec/models/user_observer_spec.rb', '/project/spec/models/user_spec.rb']
     end
     
     it &quot;should consider all specs when spec_helper changes&quot; do
-      translate('spec/spec_helper.rb').should == ['spec']
+      translate('spec/spec_helper.rb').should == ['/project/spec']
     end
     
     it &quot;should consider all specs when code under spec/shared/ changes&quot; do
-      translate('spec/shared/foo.rb').should == ['spec']
+      translate('spec/shared/foo.rb').should == ['/project/spec']
     end
     
     it &quot;should consider all specs when app configuration changes&quot; do
-      translate('config/environment.rb').should == ['spec']
-      translate('config/environments/test.rb').should == ['spec']
-      translate('config/boot.rb').should == ['spec']
+      translate('config/environment.rb').should == ['/project/spec']
+      translate('config/environments/test.rb').should == ['/project/spec']
+      translate('config/boot.rb').should == ['/project/spec']
     end
   end
   </diff>
      <filename>spec/inspector_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -37,6 +37,20 @@ describe RSpactor::Runner do
     $stdout = @old_stdout
   end
   
+  it 'should use the current directory to run in' do
+    mock_instance = mock('RunnerInstance')
+    mock_instance.stub!(:start)
+    RSpactor::Runner.should_receive(:new).with(Dir.pwd, {}).and_return(mock_instance)
+    RSpactor::Runner.start
+  end
+  
+  it 'should take an optional directory to run in' do
+    mock_instance = mock('RunnerInstance')
+    mock_instance.stub!(:start)
+    RSpactor::Runner.should_receive(:new).with('/tmp/mu', {}).and_return(mock_instance)
+    RSpactor::Runner.start(:run_in =&gt; '/tmp/mu')
+  end
+  
   describe &quot;start&quot; do
     before(:each) do
       @runner = described_class.new('/my/path')
@@ -67,7 +81,7 @@ describe RSpactor::Runner do
   
       it &quot;should run all specs if Interactor isn't interrupted&quot; do
         @interactor.should_receive(:wait_for_enter_key).and_return(nil)
-        @runner.should_receive(:run_spec_command).with('spec')
+        @runner.should_receive(:run_spec_command).with('/my/path/spec')
         setup
       end
   </diff>
      <filename>spec/runner_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>187f84c9d634c2294c196b84857ff6b31133ee87</id>
    </parent>
  </parents>
  <author>
    <name>rubyphunk</name>
    <email>treas@dynamicdudes.com</email>
  </author>
  <url>http://github.com/mislav/rspactor/commit/cb731c3b6b244a2262d238e74b2c35f8a0ec0312</url>
  <id>cb731c3b6b244a2262d238e74b2c35f8a0ec0312</id>
  <committed-date>2009-04-21T02:49:21-07:00</committed-date>
  <authored-date>2009-04-21T02:49:21-07:00</authored-date>
  <message>You can now provide an optional path in which rspactor will run/listen specs.
usage: rspactor /my/path/with/specs</message>
  <tree>9ba66757c00c4b2170e0b777adf6be74d59a68db</tree>
  <committer>
    <name>rubyphunk</name>
    <email>treas@dynamicdudes.com</email>
  </committer>
</commit>
