spec/unit/rack/formatters/yaml_spec.rb in goliath-1.0.3 vs spec/unit/rack/formatters/yaml_spec.rb in goliath-1.0.4
- old
+ new
@@ -6,11 +6,11 @@
lambda { Goliath::Rack::Formatters::YAML.new('my app') }.should_not raise_error
end
describe 'with a formatter' do
before(:each) do
- @app = mock('app').as_null_object
+ @app = double('app').as_null_object
@ym = Goliath::Rack::Formatters::YAML.new(@app)
end
it 'checks content type for text/yaml' do
@ym.yaml_response?({'Content-Type' => 'text/yaml'}).should be_true
@@ -19,10 +19,10 @@
it 'returns false for non-applicaton/yaml types' do
@ym.yaml_response?({'Content-Type' => 'application/xml'}).should be_false
end
it 'calls the app with the provided environment' do
- env_mock = mock('env').as_null_object
+ env_mock = double('env').as_null_object
@app.should_receive(:call).with(env_mock).and_return([200, {}, {"a" => 1}])
@ym.call(env_mock)
end
it 'formats the body into yaml if content-type is yaml' do