Skip to content

Commit fea9b9f

Browse files
committed
RSpec's default argument to raise_error is Exception
1 parent 0919cfe commit fea9b9f

12 files changed

Lines changed: 22 additions & 22 deletions

‎spec/unit/env_spec.rb‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
end
88

99
it 'responds to []=' do
10-
lambda { @env['test'] = 'blah' }.should_not raise_error(Exception)
10+
lambda { @env['test'] = 'blah' }.should_not raise_error
1111
end
1212

1313
it 'responds to []' do
1414
@env['test'] = 'blah'
15-
lambda { @env['test'].should == 'blah' }.should_not raise_error(Exception)
15+
lambda { @env['test'].should == 'blah' }.should_not raise_error
1616
end
1717

1818
context '#method_missing' do

‎spec/unit/rack/formatters/json_spec.rb‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
describe Goliath::Rack::Formatters::JSON do
55
it 'accepts an app' do
6-
lambda { Goliath::Rack::Formatters::JSON.new('my app') }.should_not raise_error Exception
6+
lambda { Goliath::Rack::Formatters::JSON.new('my app') }.should_not raise_error
77
end
88

99
describe 'with a formatter' do
@@ -30,7 +30,7 @@
3030
@app.should_receive(:call).and_return([200, {'Content-Type' => 'application/json'}, {:a => 1, :b => 2}])
3131

3232
status, header, body = @js.call({})
33-
lambda { Yajl::Parser.parse(body.first)['a'].should == 1 }.should_not raise_error Exception
33+
lambda { Yajl::Parser.parse(body.first)['a'].should == 1 }.should_not raise_error
3434
end
3535

3636
it "doesn't format to json if the type is not application/json" do

‎spec/unit/rack/formatters/xml_spec.rb‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
describe Goliath::Rack::Formatters::XML do
66
it 'accepts an app' do
7-
lambda { Goliath::Rack::Formatters::XML.new('my app') }.should_not raise_error Exception
7+
lambda { Goliath::Rack::Formatters::XML.new('my app') }.should_not raise_error
88
end
99

1010
describe 'with a formatter' do
@@ -31,7 +31,7 @@
3131
@app.should_receive(:call).and_return([200, {'Content-Type' => 'application/xml'}, {:a => 1, :b => 2}])
3232

3333
status, header, body = @xml.call({})
34-
lambda { Nokogiri.parse(body.first).search('a').inner_text.should == '1' }.should_not raise_error Exception
34+
lambda { Nokogiri.parse(body.first).search('a').inner_text.should == '1' }.should_not raise_error
3535
end
3636

3737
it 'generates arrays correctly' do
@@ -42,7 +42,7 @@
4242
doc = Nokogiri.parse(body.first)
4343
doc.search('item').first.inner_text.should == '1'
4444
doc.search('item').last.inner_text.should == '2'
45-
}.should_not raise_error Exception
45+
}.should_not raise_error
4646
end
4747

4848
it "doesn't format to xml if the type is not application/xml" do

‎spec/unit/rack/heartbeat_spec.rb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
describe Goliath::Rack::Heartbeat do
66
it 'accepts an app' do
7-
lambda { Goliath::Rack::Heartbeat.new('my app') }.should_not raise_error(Exception)
7+
lambda { Goliath::Rack::Heartbeat.new('my app') }.should_not raise_error
88
end
99

1010
describe 'with the middleware' do

‎spec/unit/rack/params_spec.rb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
describe Goliath::Rack::Params do
55
it 'accepts an app' do
6-
lambda { Goliath::Rack::Params.new('my app') }.should_not raise_error(Exception)
6+
lambda { Goliath::Rack::Params.new('my app') }.should_not raise_error
77
end
88

99
describe 'with middleware' do

‎spec/unit/rack/render_spec.rb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
let(:render) { Goliath::Rack::Render.new(app) }
1414

1515
it 'accepts an app' do
16-
lambda { Goliath::Rack::Render.new('my app') }.should_not raise_error(Exception)
16+
lambda { Goliath::Rack::Render.new('my app') }.should_not raise_error
1717
end
1818

1919
it 'returns the status, body and app headers' do

‎spec/unit/rack/validation/default_params_spec.rb‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
describe Goliath::Rack::Validation::DefaultParams do
55
it 'accepts an app' do
66
opts = {:defaults => ['title'], :key => 'fields'}
7-
lambda { Goliath::Rack::Validation::DefaultParams.new('my app', opts) }.should_not raise_error(Exception)
7+
lambda { Goliath::Rack::Validation::DefaultParams.new('my app', opts) }.should_not raise_error
88
end
99

1010
it 'requires defaults to be set' do
11-
lambda { Goliath::Rack::Validation::DefaultParams.new('my app', {:key => 'test'}) }.should raise_error(Exception)
11+
lambda { Goliath::Rack::Validation::DefaultParams.new('my app', {:key => 'test'}) }.should raise_error
1212
end
1313

1414
it 'requires key to be set' do
15-
lambda { Goliath::Rack::Validation::DefaultParams.new('my app', {:defaults => 'test'}) }.should raise_error(Exception)
15+
lambda { Goliath::Rack::Validation::DefaultParams.new('my app', {:defaults => 'test'}) }.should raise_error
1616
end
1717

1818
describe 'with middleware' do

‎spec/unit/rack/validation/numeric_range_spec.rb‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
it 'accepts options on create' do
1111
opts = { :min => 1, :key => 2 }
12-
lambda { Goliath::Rack::Validation::NumericRange.new('my app', opts) }.should_not raise_error(Exception)
12+
lambda { Goliath::Rack::Validation::NumericRange.new('my app', opts) }.should_not raise_error
1313
end
1414

1515
describe 'with middleware' do
@@ -59,11 +59,11 @@
5959
end
6060

6161
it 'raises error if key is not set' do
62-
lambda { Goliath::Rack::Validation::NumericRange.new('app', {:min => 5}) }.should raise_error(Exception)
62+
lambda { Goliath::Rack::Validation::NumericRange.new('app', {:min => 5}) }.should raise_error
6363
end
6464

6565
it 'raises error if neither min nor max set' do
66-
lambda { Goliath::Rack::Validation::NumericRange.new('app', {:key => 5}) }.should raise_error(Exception)
66+
lambda { Goliath::Rack::Validation::NumericRange.new('app', {:key => 5}) }.should raise_error
6767
end
6868

6969
it 'uses min if default not set' do

‎spec/unit/rack/validation/request_method_spec.rb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
end
88

99
it 'accepts an app' do
10-
lambda { Goliath::Rack::Validation::RequestMethod.new('my app') }.should_not raise_error(Exception)
10+
lambda { Goliath::Rack::Validation::RequestMethod.new('my app') }.should_not raise_error
1111
end
1212

1313
describe 'with defaults' do

‎spec/unit/rack/validation/required_param_spec.rb‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33

44
describe Goliath::Rack::Validation::RequiredParam do
55
it 'accepts an app' do
6-
lambda { Goliath::Rack::Validation::RequiredParam.new('my app') }.should_not raise_error(Exception)
6+
lambda { Goliath::Rack::Validation::RequiredParam.new('my app') }.should_not raise_error
77
end
88

99
it 'accepts options on create' do
1010
opts = { :type => 1, :key => 2 }
11-
lambda { Goliath::Rack::Validation::RequiredParam.new('my app', opts) }.should_not raise_error(Exception)
11+
lambda { Goliath::Rack::Validation::RequiredParam.new('my app', opts) }.should_not raise_error
1212
end
1313

1414
it 'defaults type and key' do

0 commit comments

Comments
 (0)