2018-11-27 15:38:57 -05:00
|
|
|
describe :sizedqueue_new, shared: true do
|
|
|
|
it "raises a TypeError when the given argument is not Numeric" do
|
2019-07-27 06:40:09 -04:00
|
|
|
-> { @object.call("foo") }.should raise_error(TypeError)
|
|
|
|
-> { @object.call(Object.new) }.should raise_error(TypeError)
|
2018-11-27 15:38:57 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
it "raises an argument error when no argument is given" do
|
2019-07-27 06:40:09 -04:00
|
|
|
-> { @object.call }.should raise_error(ArgumentError)
|
2018-11-27 15:38:57 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
it "raises an argument error when the given argument is zero" do
|
2019-07-27 06:40:09 -04:00
|
|
|
-> { @object.call(0) }.should raise_error(ArgumentError)
|
2018-11-27 15:38:57 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
it "raises an argument error when the given argument is negative" do
|
2019-07-27 06:40:09 -04:00
|
|
|
-> { @object.call(-1) }.should raise_error(ArgumentError)
|
2018-11-27 15:38:57 -05:00
|
|
|
end
|
|
|
|
end
|