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
|
@ -14,7 +14,7 @@ describe "String#delete" do
|
|||
end
|
||||
|
||||
it "raises an ArgumentError when given no arguments" do
|
||||
lambda { "hell yeah".delete }.should raise_error(ArgumentError)
|
||||
-> { "hell yeah".delete }.should raise_error(ArgumentError)
|
||||
end
|
||||
|
||||
it "negates sets starting with ^" do
|
||||
|
@ -62,10 +62,10 @@ describe "String#delete" do
|
|||
not_supported_on :opal do
|
||||
xFF = [0xFF].pack('C')
|
||||
range = "\x00 - #{xFF}".force_encoding('utf-8')
|
||||
lambda { "hello".delete(range).should == "" }.should raise_error(ArgumentError)
|
||||
-> { "hello".delete(range).should == "" }.should raise_error(ArgumentError)
|
||||
end
|
||||
lambda { "hello".delete("h-e") }.should raise_error(ArgumentError)
|
||||
lambda { "hello".delete("^h-e") }.should raise_error(ArgumentError)
|
||||
-> { "hello".delete("h-e") }.should raise_error(ArgumentError)
|
||||
-> { "hello".delete("^h-e") }.should raise_error(ArgumentError)
|
||||
end
|
||||
|
||||
it "taints result when self is tainted" do
|
||||
|
@ -86,9 +86,9 @@ describe "String#delete" do
|
|||
end
|
||||
|
||||
it "raises a TypeError when one set arg can't be converted to a string" do
|
||||
lambda { "hello world".delete(100) }.should raise_error(TypeError)
|
||||
lambda { "hello world".delete([]) }.should raise_error(TypeError)
|
||||
lambda { "hello world".delete(mock('x')) }.should raise_error(TypeError)
|
||||
-> { "hello world".delete(100) }.should raise_error(TypeError)
|
||||
-> { "hello world".delete([]) }.should raise_error(TypeError)
|
||||
-> { "hello world".delete(mock('x')) }.should raise_error(TypeError)
|
||||
end
|
||||
|
||||
it "returns subclass instances when called on a subclass" do
|
||||
|
@ -113,7 +113,7 @@ describe "String#delete!" do
|
|||
a = "hello"
|
||||
a.freeze
|
||||
|
||||
lambda { a.delete!("") }.should raise_error(frozen_error_class)
|
||||
lambda { a.delete!("aeiou", "^e") }.should raise_error(frozen_error_class)
|
||||
-> { a.delete!("") }.should raise_error(frozen_error_class)
|
||||
-> { a.delete!("aeiou", "^e") }.should raise_error(frozen_error_class)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue