Permalink
Browse files

reinstate changes made in 5a7f3c1

  • Loading branch information...
1 parent 5a8024b commit 4b8ae71e951d202fa34b7759915ffb8a30fc8c71 @chadoh chadoh committed Feb 21, 2013
Showing with 7 additions and 73 deletions.
  1. +0 −5 lib/guard/minitest/runner.rb
  2. +7 −68 spec/guard/minitest/runner_spec.rb
@@ -66,11 +66,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__)}"
- 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'
@@ -163,74 +163,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 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 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 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 spec/spec_helper.rb ./test/test_minitest.rb"
- )
- runner.run(['test/test_minitest.rb'], :drb => true)
- end
-
- it 'should run with drb and notification disabled' 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 spec/spec_helper.rb ./test/test_minitest.rb"
- )
- runner.run(['test/test_minitest.rb'], :drb => true)
- end
-
- it 'should run with drb and notification enabled' 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 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 4b8ae71

Please sign in to comment.