spec/vnctools/server_pool_spec.rb in vnctools-0.0.7 vs spec/vnctools/server_pool_spec.rb in vnctools-0.0.8
- old
+ new
@@ -1,11 +1,11 @@
require File.expand_path("../../spec_helper", __FILE__)
module VncTools
describe ServerPool do
- let(:server) { mock(Server, :start => nil, :stop => nil) }
- let(:fake_server_class) { mock(:new => server)}
+ let(:server) { double(Server, :start => nil, :stop => nil) }
+ let(:fake_server_class) { double(:new => server)}
let(:pool) { ServerPool.new(3, fake_server_class) }
it "creates 3 instances of the given display class" do
fake_server_class.should_receive(:new).exactly(3).times
@@ -40,10 +40,10 @@
3.times { pool.get }
lambda { pool.get }.should raise_error(ServerPool::OutOfDisplaysError)
end
it "notifies observers" do
- observer = mock(Observable)
+ observer = double(Observable)
observer.should_receive(:update).with :on_display_starting, server
observer.should_receive(:update).with :on_display_fetched , server
observer.should_receive(:update).with :on_display_released, server
observer.should_receive(:update).with :on_display_stopping , server