spec/unit/rack/formatters/xml_spec.rb in goliath-0.9.0 vs spec/unit/rack/formatters/xml_spec.rb in goliath-0.9.1
- old
+ new
@@ -2,11 +2,11 @@
require 'goliath/rack/formatters/xml'
require 'nokogiri'
describe Goliath::Rack::Formatters::XML do
it 'accepts an app' do
- lambda { Goliath::Rack::Formatters::XML.new('my app') }.should_not raise_error Exception
+ lambda { Goliath::Rack::Formatters::XML.new('my app') }.should_not raise_error
end
describe 'with a formatter' do
before(:each) do
@app = mock('app').as_null_object
@@ -29,21 +29,21 @@
it 'formats the body into xml if content-type is xml' do
@app.should_receive(:call).and_return([200, {'Content-Type' => 'application/xml'}, {:a => 1, :b => 2}])
status, header, body = @xml.call({})
- lambda { Nokogiri.parse(body.first).search('a').inner_text.should == '1' }.should_not raise_error Exception
+ lambda { Nokogiri.parse(body.first).search('a').inner_text.should == '1' }.should_not raise_error
end
it 'generates arrays correctly' do
@app.should_receive(:call).and_return([200, {'Content-Type' => 'application/xml'}, [1, 2]])
status, header, body = @xml.call({})
lambda {
doc = Nokogiri.parse(body.first)
doc.search('item').first.inner_text.should == '1'
doc.search('item').last.inner_text.should == '2'
- }.should_not raise_error Exception
+ }.should_not raise_error
end
it "doesn't format to xml if the type is not application/xml" do
@app.should_receive(:call).and_return([200, {'Content-Type' => 'application/json'}, {:a => 1, :b => 2}])