mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@875a09e
This commit is contained in:
parent
a06301b103
commit
5c276e1cc9
1247 changed files with 5316 additions and 5028 deletions
|
@ -4,15 +4,15 @@ require_relative 'fixtures/classes'
|
|||
|
||||
describe "String#index" do
|
||||
it "raises a TypeError if passed nil" do
|
||||
lambda { "abc".index nil }.should raise_error(TypeError)
|
||||
-> { "abc".index nil }.should raise_error(TypeError)
|
||||
end
|
||||
|
||||
it "raises a TypeError if passed a boolean" do
|
||||
lambda { "abc".index true }.should raise_error(TypeError)
|
||||
-> { "abc".index true }.should raise_error(TypeError)
|
||||
end
|
||||
|
||||
it "raises a TypeError if passed a Symbol" do
|
||||
lambda { "abc".index :a }.should raise_error(TypeError)
|
||||
-> { "abc".index :a }.should raise_error(TypeError)
|
||||
end
|
||||
|
||||
it "calls #to_str to convert the first argument" do
|
||||
|
@ -28,7 +28,7 @@ describe "String#index" do
|
|||
end
|
||||
|
||||
it "raises a TypeError if passed a Fixnum" do
|
||||
lambda { "abc".index 97 }.should raise_error(TypeError)
|
||||
-> { "abc".index 97 }.should raise_error(TypeError)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -154,7 +154,7 @@ describe "String#index with String" do
|
|||
|
||||
it "raises an Encoding::CompatibilityError if the encodings are incompatible" do
|
||||
char = "れ".encode Encoding::EUC_JP
|
||||
lambda do
|
||||
-> do
|
||||
"あれ".index char
|
||||
end.should raise_error(Encoding::CompatibilityError)
|
||||
end
|
||||
|
@ -305,7 +305,7 @@ describe "String#index with Regexp" do
|
|||
|
||||
it "raises an Encoding::CompatibilityError if the encodings are incompatible" do
|
||||
re = Regexp.new "れ".encode(Encoding::EUC_JP)
|
||||
lambda do
|
||||
-> do
|
||||
"あれ".index re
|
||||
end.should raise_error(Encoding::CompatibilityError)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue