spec/invoker/commander_spec.rb in invoker-1.0.2 vs spec/invoker/commander_spec.rb in invoker-1.0.3
- old
+ new
@@ -8,13 +8,13 @@
end
it "should throw error" do
invoker_config.stubs(:processes).returns([])
- lambda {
+ expect {
@commander.start_manager()
- }.should.raise(Invoker::Errors::InvalidConfig)
+ }.to raise_error(Invoker::Errors::InvalidConfig)
end
end
describe "#add_command_by_label" do
before do
@@ -38,18 +38,18 @@
end
describe "if a signal is specified" do
it "should use that signal to kill the worker" do
@commander.expects(:process_kill).with("bogus", "HUP").returns(true)
- @commander.remove_command("resque", "HUP").should.be.true
+ expect(@commander.remove_command("resque", "HUP")).to be_true
end
end
describe "if no signal is specified" do
it "should use INT signal" do
@commander.expects(:process_kill).with("bogus", "INT").returns(true)
- @commander.remove_command("resque", nil).should.be.true
+ expect(@commander.remove_command("resque", nil)).to be_true
end
end
# describe "when a worker is not found" do
# before do
@@ -89,20 +89,20 @@
end
it "should populate workers and open_pipes" do
@commander.expects(:start_event_loop)
@commander.start_manager()
- @commander.open_pipes.should.not.be.empty
- @commander.workers.should.not.be.empty
+ expect(@commander.open_pipes).not_to be_empty
+ expect(@commander.workers).not_to be_empty
worker = @commander.workers['sleep']
- worker.should.not.equal nil
- worker.command_label.should.equal "sleep"
- worker.color.should.equal :green
+ expect(worker).not_to be_nil
+ expect(worker.command_label).to eq('sleep')
+ expect(worker.color).to eq(:green)
pipe_end_worker = @commander.open_pipes[worker.pipe_end.fileno]
- pipe_end_worker.should.not.equal nil
+ expect(pipe_end_worker).not_to be_nil
end
end
describe "#runnables" do
before do