mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@6f38a82
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63293 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b864bd05bf
commit
4fbb9aa3cb
145 changed files with 2847 additions and 2596 deletions
|
@ -3,25 +3,11 @@ describe :delete_if, shared: true do
|
|||
@object = [1,2,3]
|
||||
end
|
||||
|
||||
ruby_version_is "2.3" do
|
||||
it "updates the receiver after all blocks" do
|
||||
@object.send(@method) do |e|
|
||||
@object.length.should == 3
|
||||
true
|
||||
end
|
||||
@object.length.should == 0
|
||||
end
|
||||
end
|
||||
|
||||
ruby_version_is ""..."2.3" do
|
||||
it "updates the receiver after each true block" do
|
||||
count = 0
|
||||
@object.send(@method) do |e|
|
||||
@object.length.should == (3 - count)
|
||||
count += 1
|
||||
true
|
||||
end
|
||||
@object.length.should == 0
|
||||
it "updates the receiver after all blocks" do
|
||||
@object.send(@method) do |e|
|
||||
@object.length.should == 3
|
||||
true
|
||||
end
|
||||
@object.length.should == 0
|
||||
end
|
||||
end
|
||||
|
|
|
@ -121,24 +121,11 @@ describe :array_inspect, shared: true do
|
|||
array.send(@method).encoding.name.should == "US-ASCII"
|
||||
end
|
||||
|
||||
ruby_version_is ''...'2.3' do
|
||||
it "raises if inspected result is not default external encoding" do
|
||||
utf_16be = mock("utf_16be")
|
||||
utf_16be.should_receive(:inspect).and_return(%<"utf_16be \u3042">.encode!(Encoding::UTF_16BE))
|
||||
it "does not raise if inspected result is not default external encoding" do
|
||||
utf_16be = mock("utf_16be")
|
||||
utf_16be.should_receive(:inspect).and_return(%<"utf_16be \u3042">.encode!(Encoding::UTF_16BE))
|
||||
|
||||
lambda {
|
||||
[utf_16be].send(@method)
|
||||
}.should raise_error(Encoding::CompatibilityError)
|
||||
end
|
||||
end
|
||||
|
||||
ruby_version_is '2.3' do
|
||||
it "does not raise if inspected result is not default external encoding" do
|
||||
utf_16be = mock("utf_16be")
|
||||
utf_16be.should_receive(:inspect).and_return(%<"utf_16be \u3042">.encode!(Encoding::UTF_16BE))
|
||||
|
||||
[utf_16be].send(@method).should == '["utf_16be \u3042"]'
|
||||
end
|
||||
[utf_16be].send(@method).should == '["utf_16be \u3042"]'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue