spec/guard/delayed_spec.rb in guard-delayed-0.1.1 vs spec/guard/delayed_spec.rb in guard-delayed-0.1.2
- old
+ new
@@ -1,20 +1,12 @@
require 'spec_helper'
describe Guard::Delayed do
- subject { Guard::Delayed.new }
-
- describe "start" do
- before do
- subject = Guard::Delayed.new
- end
-
- after do
- subject.stop
- end
-
- it "should create a pid in /tmp/pids" do
- subject.start
- Dir.glob("tmp/pids/delayed_job*.pid").should_not be_empty
+ describe "when passing an environment option" do
+ it "calls system with 'export RAILS_ENV=test;' call first" do
+ @delayed = Guard::Delayed.new([], {:environment => 'test'})
+ @delayed.should_receive(:system).with("export RAILS_ENV=test; script/delayed_job stop").and_return(true)
+ @delayed.should_receive(:system).with("export RAILS_ENV=test; script/delayed_job start").and_return(true)
+ @delayed.start
end
end
end