spec/unit/rack/validation/numeric_range_spec.rb in goliath-1.0.4 vs spec/unit/rack/validation/numeric_range_spec.rb in goliath-1.0.5
- old
+ new
@@ -64,14 +64,14 @@
nr.call(@env)
@env['params']['id'].should == 1.5
end
it 'raises error if key is not set' do
- lambda { Goliath::Rack::Validation::NumericRange.new('app', {:min => 5}) }.should raise_error
+ lambda { Goliath::Rack::Validation::NumericRange.new('app', {:min => 5}) }.should raise_error('NumericRange key required')
end
it 'raises error if neither min nor max set' do
- lambda { Goliath::Rack::Validation::NumericRange.new('app', {:key => 5}) }.should raise_error
+ lambda { Goliath::Rack::Validation::NumericRange.new('app', {:key => 5}) }.should raise_error('NumericRange requires :min or :max')
end
it 'uses min if default not set' do
nr = Goliath::Rack::Validation::NumericRange.new(@app, {:key => 'id', :min => 5, :max => 10})
@env['params']['id'] = 15