1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
This commit is contained in:
Benoit Daloze 2019-07-27 12:40:09 +02:00
parent a06301b103
commit 5c276e1cc9
1247 changed files with 5316 additions and 5028 deletions

View file

@ -9,22 +9,22 @@ describe "Range#bsearch" do
it_behaves_like :enumeratorized_with_unknown_size, :bsearch, (1..3)
it "raises a TypeError if the block returns an Object" do
lambda { (0..1).bsearch { Object.new } }.should raise_error(TypeError)
-> { (0..1).bsearch { Object.new } }.should raise_error(TypeError)
end
it "raises a TypeError if the block returns a String" do
lambda { (0..1).bsearch { "1" } }.should raise_error(TypeError)
-> { (0..1).bsearch { "1" } }.should raise_error(TypeError)
end
it "raises a TypeError if the Range has Object values" do
value = mock("range bsearch")
r = Range.new value, value
lambda { r.bsearch { true } }.should raise_error(TypeError)
-> { r.bsearch { true } }.should raise_error(TypeError)
end
it "raises a TypeError if the Range has String values" do
lambda { ("a".."e").bsearch { true } }.should raise_error(TypeError)
-> { ("a".."e").bsearch { true } }.should raise_error(TypeError)
end
context "with Integer values" do