Permalink
Browse files

Simplifying the DRb version of the runner so that it works with the t…

…estdrb implementation in spork-minitest (not sure what the other one was set up for)
  • Loading branch information...
1 parent c20bb30 commit 5a7f3c1e805fc366a5918210ac75d95730b55a09 @chadoh chadoh committed May 1, 2012
Showing with 7 additions and 74 deletions.
  1. +0 −6 lib/guard/minitest/runner.rb
  2. +7 −68 spec/guard/minitest/runner_spec.rb
@@ -72,12 +72,6 @@ def minitest_command(paths)
cmd_parts << "bundle exec" if bundler?
if drb?
cmd_parts << 'testdrb'
- cmd_parts << "-r #{File.expand_path('../runners/default_runner.rb', __FILE__)}"
- cmd_parts << "-e '::GUARD_NOTIFY=#{notify?}'"
- test_folders.each do |f|
- cmd_parts << "#{f}/test_helper.rb" if File.exist?("#{f}/test_helper.rb")
- cmd_parts << "#{f}/spec_helper.rb" if File.exist?("#{f}/spec_helper.rb")
- end
cmd_parts += paths.map{|path| "./#{path}" }
else
cmd_parts << 'ruby'
@@ -175,74 +175,13 @@
end
describe 'drb' do
- describe 'when using test_helper' do
- it 'should run with drb' do
- runner = subject.new(:test_folders => %w[test], :drb => true)
- Guard::UI.expects(:info)
- File.expects(:exist?).with('test/test_helper.rb').returns(true)
- File.expects(:exist?).with('test/spec_helper.rb').returns(false)
- runner.expects(:system).with(
- "testdrb -r #{File.expand_path('.')}/lib/guard/minitest/runners/default_runner.rb -e '::GUARD_NOTIFY=false' test/test_helper.rb ./test/test_minitest.rb"
- )
- runner.run(['test/test_minitest.rb'], :drb => true)
- end
-
- it 'should run with drb and notification disable' do
- runner = subject.new(:test_folders => %w[test], :drb => true, :notification => false)
- Guard::UI.expects(:info)
- File.expects(:exist?).with('test/test_helper.rb').returns(true)
- File.expects(:exist?).with('test/spec_helper.rb').returns(false)
- runner.expects(:system).with(
- "testdrb -r #{File.expand_path('.')}/lib/guard/minitest/runners/default_runner.rb -e '::GUARD_NOTIFY=false' test/test_helper.rb ./test/test_minitest.rb"
- )
- runner.run(['test/test_minitest.rb'], :drb => true)
- end
-
- it 'should run with drb and notification enable' do
- runner = subject.new(:test_folders => %w[test], :drb => true, :notification => true)
- Guard::UI.expects(:info)
- File.expects(:exist?).with('test/test_helper.rb').returns(true)
- File.expects(:exist?).with('test/spec_helper.rb').returns(false)
- runner.expects(:system).with(
- "testdrb -r #{File.expand_path('.')}/lib/guard/minitest/runners/default_runner.rb -e '::GUARD_NOTIFY=true' test/test_helper.rb ./test/test_minitest.rb"
- )
- runner.run(['test/test_minitest.rb'], :drb => true)
- end
- end
-
- describe 'when using spec_helper' do
- it 'should run with drb' do
- runner = subject.new(:test_folders => %w[spec], :drb => true)
- Guard::UI.expects(:info)
- File.expects(:exist?).with('spec/test_helper.rb').returns(false)
- File.expects(:exist?).with('spec/spec_helper.rb').returns(true)
- runner.expects(:system).with(
- "testdrb -r #{File.expand_path('.')}/lib/guard/minitest/runners/default_runner.rb -e '::GUARD_NOTIFY=false' spec/spec_helper.rb ./test/test_minitest.rb"
- )
- runner.run(['test/test_minitest.rb'], :drb => true)
- end
-
- it 'should run with drb and notification disable' do
- runner = subject.new(:test_folders => %w[spec], :drb => true, :notification => false)
- Guard::UI.expects(:info)
- File.expects(:exist?).with('spec/test_helper.rb').returns(false)
- File.expects(:exist?).with('spec/spec_helper.rb').returns(true)
- runner.expects(:system).with(
- "testdrb -r #{File.expand_path('.')}/lib/guard/minitest/runners/default_runner.rb -e '::GUARD_NOTIFY=false' spec/spec_helper.rb ./test/test_minitest.rb"
- )
- runner.run(['test/test_minitest.rb'], :drb => true)
- end
-
- it 'should run with drb and notification disable' do
- runner = subject.new(:test_folders => %w[spec], :drb => true, :notification => true)
- Guard::UI.expects(:info)
- File.expects(:exist?).with('spec/test_helper.rb').returns(false)
- File.expects(:exist?).with('spec/spec_helper.rb').returns(true)
- runner.expects(:system).with(
- "testdrb -r #{File.expand_path('.')}/lib/guard/minitest/runners/default_runner.rb -e '::GUARD_NOTIFY=true' spec/spec_helper.rb ./test/test_minitest.rb"
- )
- runner.run(['test/test_minitest.rb'], :drb => true)
- end
+ it 'should run with drb' do
+ runner = subject.new(:test_folders => %w[test], :drb => true)
+ Guard::UI.expects(:info)
+ runner.expects(:system).with(
+ "testdrb ./test/test_minitest.rb"
+ )
+ runner.run(['test/test_minitest.rb'], :drb => true)
end
end
end

0 comments on commit 5a7f3c1

Please sign in to comment.