spec/unit/connection_spec.rb in goliath-1.0.3 vs spec/unit/connection_spec.rb in goliath-1.0.4
- old
+ new
@@ -5,29 +5,29 @@
@c = Goliath::Connection.new('blah')
end
describe 'configuration' do
it 'accepts an app' do
- app = mock('app')
+ app = double('app')
@c.app = app
@c.app.should == app
end
it 'accepts a logger' do
- logger = mock('logger')
+ logger = double('logger')
@c.logger = logger
@c.logger.should == logger
end
it 'accepts a status object' do
- status = mock('status')
+ status = double('status')
@c.status = status
@c.status.should == status
end
it 'accepts config' do
- config = mock('config')
+ config = double('config')
@c.config = config
@c.config.should == config
end
end
@@ -38,21 +38,21 @@
end
end
describe 'receive_data' do
it 'passes data to the http parser' do
- request_mock = mock("parser").as_null_object
+ request_mock = double("parser").as_null_object
request_mock.should_receive(:<<)
- current_mock = mock("current").as_null_object
+ current_mock = double("current").as_null_object
@c.instance_variable_set("@parser", request_mock)
@c.instance_variable_set("@current", current_mock)
@c.receive_data('more_data')
end
it "closes the connection when a parse error is received" do
- current_mock = mock("current").as_null_object
+ current_mock = double("current").as_null_object
current_mock.should_receive(:close)
@c.instance_variable_set("@current", current_mock)
lambda { @c.receive_data("bad data") }.should_not raise_error
end