Permalink
Browse files

Back to system to spork command

  • Loading branch information...
1 parent 6cf04db commit b47d93681e3dd8aa02019d9dea63b29433837459 Thibaud Guillaume-Gentil committed Nov 18, 2010
Showing with 13 additions and 11 deletions.
  1. +3 −2 guard-spork.gemspec
  2. +1 −0 lib/guard/spork.rb
  3. +3 −3 lib/guard/spork/runner.rb
  4. +6 −6 spec/guard/spork/runner_spec.rb
View
5 guard-spork.gemspec
@@ -18,8 +18,9 @@ Gem::Specification.new do |s|
s.add_dependency 'guard', '>= 0.2.0'
s.add_dependency 'spork', '>= 0.8.4'
- s.add_development_dependency 'bundler', '~> 1.0.3'
- s.add_development_dependency 'rspec', '~> 2.1'
+ s.add_development_dependency 'bundler', '~> 1.0.7'
+ s.add_development_dependency 'rspec', '~> 2.1'
+ s.add_development_dependency 'guard-rspec', '~> 0.1.8'
s.files = Dir.glob('{lib}/**/*') + %w[LICENSE README.rdoc]
s.require_path = 'lib'
View
1 lib/guard/spork.rb
@@ -10,6 +10,7 @@ class Spork < Guard
def initialize(watchers = [], options = {})
super
@runner = Runner.new(options)
+
end
def start
View
6 lib/guard/spork/runner.rb
@@ -14,8 +14,8 @@ def initialize(options = {})
def launch_sporks(action)
UI.info "#{action.capitalize}ing Spork for #{sporked_gems} ", :reset => true
- IO.popen(spork_command("rspec")) if rspec?
- IO.popen(spork_command("cucumber")) if cucumber?
+ system(spork_command("rspec")) if rspec?
+ system(spork_command("cucumber")) if cucumber?
verify_launches(action)
end
@@ -38,7 +38,7 @@ def spork_command(type)
cmd_parts << "-p #{options[:cucumber_port]}"
end
- cmd_parts << "2>&1"
+ cmd_parts << ">/dev/null 2>&1 < /dev/null &"
cmd_parts.join(" ")
end
View
12 spec/guard/spork/runner_spec.rb
@@ -20,7 +20,7 @@
end
it "should launch rspec spork server" do
- IO.should_receive(:popen).with("spork -p 8989 2>&1")
+ subject.should_receive(:system).with("spork -p 8989 >/dev/null 2>&1 < /dev/null &")
subject.launch_sporks("start")
end
end
@@ -34,7 +34,7 @@
end
it "should launch cucumber spork server" do
- IO.should_receive(:popen).with("spork cu -p 8990 2>&1")
+ subject.should_receive(:system).with("spork cu -p 8990 >/dev/null 2>&1 < /dev/null &")
subject.launch_sporks("start")
end
end
@@ -49,8 +49,8 @@
end
it "should launch rspec & cucumber spork server" do
- IO.should_receive(:popen).with("spork -p 8989 2>&1")
- IO.should_receive(:popen).with("spork cu -p 8990 2>&1")
+ subject.should_receive(:system).with("spork -p 8989 >/dev/null 2>&1 < /dev/null &")
+ subject.should_receive(:system).with("spork cu -p 8990 >/dev/null 2>&1 < /dev/null &")
subject.launch_sporks("start")
end
end
@@ -65,8 +65,8 @@
end
it "should launch rspec & cucumber spork server" do
- IO.should_receive(:popen).with("bundle exec spork -p 8989 2>&1")
- IO.should_receive(:popen).with("bundle exec spork cu -p 8990 2>&1")
+ subject.should_receive(:system).with("bundle exec spork -p 8989 >/dev/null 2>&1 < /dev/null &")
+ subject.should_receive(:system).with("bundle exec spork cu -p 8990 >/dev/null 2>&1 < /dev/null &")
subject.launch_sporks("start")
end
end

0 comments on commit b47d936

Please sign in to comment.