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

@ -51,11 +51,11 @@ describe "String#setbyte" do
end
it "raises an IndexError if the index is greater than the String bytesize" do
lambda { "?".setbyte(1, 97) }.should raise_error(IndexError)
-> { "?".setbyte(1, 97) }.should raise_error(IndexError)
end
it "raises an IndexError if the negative index is greater magnitude than the String bytesize" do
lambda { "???".setbyte(-5, 97) }.should raise_error(IndexError)
-> { "???".setbyte(-5, 97) }.should raise_error(IndexError)
end
it "sets a byte at an index greater than String size" do
@ -78,11 +78,11 @@ describe "String#setbyte" do
it "raises a #{frozen_error_class} if self is frozen" do
str = "cold".freeze
str.frozen?.should be_true
lambda { str.setbyte(3,96) }.should raise_error(frozen_error_class)
-> { str.setbyte(3,96) }.should raise_error(frozen_error_class)
end
it "raises a TypeError unless the second argument is an Integer" do
lambda { "a".setbyte(0,'a') }.should raise_error(TypeError)
-> { "a".setbyte(0,'a') }.should raise_error(TypeError)
end
it "calls #to_int to convert the index" do