mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@0fe33ac
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0f989b87a0
commit
a34db218ad
162 changed files with 1267 additions and 621 deletions
|
@ -53,10 +53,10 @@ describe "String#slice! with index" do
|
|||
a.should == "hello"
|
||||
end
|
||||
|
||||
it "raises a RuntimeError if self is frozen" do
|
||||
lambda { "hello".freeze.slice!(1) }.should raise_error(RuntimeError)
|
||||
lambda { "hello".freeze.slice!(10) }.should raise_error(RuntimeError)
|
||||
lambda { "".freeze.slice!(0) }.should raise_error(RuntimeError)
|
||||
it "raises a #{frozen_error_class} if self is frozen" do
|
||||
lambda { "hello".freeze.slice!(1) }.should raise_error(frozen_error_class)
|
||||
lambda { "hello".freeze.slice!(10) }.should raise_error(frozen_error_class)
|
||||
lambda { "".freeze.slice!(0) }.should raise_error(frozen_error_class)
|
||||
end
|
||||
|
||||
it "calls to_int on index" do
|
||||
|
@ -119,14 +119,14 @@ describe "String#slice! with index, length" do
|
|||
a.should == "hello"
|
||||
end
|
||||
|
||||
it "raises a RuntimeError if self is frozen" do
|
||||
lambda { "hello".freeze.slice!(1, 2) }.should raise_error(RuntimeError)
|
||||
lambda { "hello".freeze.slice!(10, 3) }.should raise_error(RuntimeError)
|
||||
lambda { "hello".freeze.slice!(-10, 3)}.should raise_error(RuntimeError)
|
||||
lambda { "hello".freeze.slice!(4, -3) }.should raise_error(RuntimeError)
|
||||
lambda { "hello".freeze.slice!(10, 3) }.should raise_error(RuntimeError)
|
||||
lambda { "hello".freeze.slice!(-10, 3)}.should raise_error(RuntimeError)
|
||||
lambda { "hello".freeze.slice!(4, -3) }.should raise_error(RuntimeError)
|
||||
it "raises a #{frozen_error_class} if self is frozen" do
|
||||
lambda { "hello".freeze.slice!(1, 2) }.should raise_error(frozen_error_class)
|
||||
lambda { "hello".freeze.slice!(10, 3) }.should raise_error(frozen_error_class)
|
||||
lambda { "hello".freeze.slice!(-10, 3)}.should raise_error(frozen_error_class)
|
||||
lambda { "hello".freeze.slice!(4, -3) }.should raise_error(frozen_error_class)
|
||||
lambda { "hello".freeze.slice!(10, 3) }.should raise_error(frozen_error_class)
|
||||
lambda { "hello".freeze.slice!(-10, 3)}.should raise_error(frozen_error_class)
|
||||
lambda { "hello".freeze.slice!(4, -3) }.should raise_error(frozen_error_class)
|
||||
end
|
||||
|
||||
it "calls to_int on idx and length" do
|
||||
|
@ -250,13 +250,13 @@ describe "String#slice! Range" do
|
|||
|
||||
end
|
||||
|
||||
it "raises a RuntimeError on a frozen instance that is modified" do
|
||||
lambda { "hello".freeze.slice!(1..3) }.should raise_error(RuntimeError)
|
||||
it "raises a #{frozen_error_class} on a frozen instance that is modified" do
|
||||
lambda { "hello".freeze.slice!(1..3) }.should raise_error(frozen_error_class)
|
||||
end
|
||||
|
||||
# see redmine #1551
|
||||
it "raises a RuntimeError on a frozen instance that would not be modified" do
|
||||
lambda { "hello".freeze.slice!(10..20)}.should raise_error(RuntimeError)
|
||||
it "raises a #{frozen_error_class} on a frozen instance that would not be modified" do
|
||||
lambda { "hello".freeze.slice!(10..20)}.should raise_error(frozen_error_class)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -320,12 +320,12 @@ describe "String#slice! with Regexp" do
|
|||
$~.should == nil
|
||||
end
|
||||
|
||||
it "raises a RuntimeError on a frozen instance that is modified" do
|
||||
lambda { "this is a string".freeze.slice!(/s.*t/) }.should raise_error(RuntimeError)
|
||||
it "raises a #{frozen_error_class} on a frozen instance that is modified" do
|
||||
lambda { "this is a string".freeze.slice!(/s.*t/) }.should raise_error(frozen_error_class)
|
||||
end
|
||||
|
||||
it "raises a RuntimeError on a frozen instance that would not be modified" do
|
||||
lambda { "this is a string".freeze.slice!(/zzz/) }.should raise_error(RuntimeError)
|
||||
it "raises a #{frozen_error_class} on a frozen instance that would not be modified" do
|
||||
lambda { "this is a string".freeze.slice!(/zzz/) }.should raise_error(frozen_error_class)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -412,10 +412,10 @@ describe "String#slice! with Regexp, index" do
|
|||
$~.should == nil
|
||||
end
|
||||
|
||||
it "raises a RuntimeError if self is frozen" do
|
||||
lambda { "this is a string".freeze.slice!(/s.*t/) }.should raise_error(RuntimeError)
|
||||
lambda { "this is a string".freeze.slice!(/zzz/, 0)}.should raise_error(RuntimeError)
|
||||
lambda { "this is a string".freeze.slice!(/(.)/, 2)}.should raise_error(RuntimeError)
|
||||
it "raises a #{frozen_error_class} if self is frozen" do
|
||||
lambda { "this is a string".freeze.slice!(/s.*t/) }.should raise_error(frozen_error_class)
|
||||
lambda { "this is a string".freeze.slice!(/zzz/, 0)}.should raise_error(frozen_error_class)
|
||||
lambda { "this is a string".freeze.slice!(/(.)/, 2)}.should raise_error(frozen_error_class)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -468,9 +468,9 @@ describe "String#slice! with String" do
|
|||
r.should be_an_instance_of(StringSpecs::MyString)
|
||||
end
|
||||
|
||||
it "raises a RuntimeError if self is frozen" do
|
||||
lambda { "hello hello".freeze.slice!('llo') }.should raise_error(RuntimeError)
|
||||
lambda { "this is a string".freeze.slice!('zzz')}.should raise_error(RuntimeError)
|
||||
lambda { "this is a string".freeze.slice!('zzz')}.should raise_error(RuntimeError)
|
||||
it "raises a #{frozen_error_class} if self is frozen" do
|
||||
lambda { "hello hello".freeze.slice!('llo') }.should raise_error(frozen_error_class)
|
||||
lambda { "this is a string".freeze.slice!('zzz')}.should raise_error(frozen_error_class)
|
||||
lambda { "this is a string".freeze.slice!('zzz')}.should raise_error(frozen_error_class)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue