Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Object#inspect must be compatible with default external encoding

  • Loading branch information...
commit 57d0df2b048efe4fcad0ba6f7240c0f3290e8a94 1 parent 57b670b
@nurse nurse authored
Showing with 3 additions and 5 deletions.
  1. +3 −5 core/array/shared/inspect.rb
View
8 core/array/shared/inspect.rb
@@ -67,14 +67,12 @@
result.should == "[euc_jp, utf_8]".encode(Encoding::EUC_JP)
end
- ruby_bug "5848", "2.0" do
- it "copies the ASCII-incompatible encoding of the result of inspecting the first element" do
+ ruby_version_is "2.0" 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".encode!(Encoding::UTF_16BE))
- result = [utf_16be].send(@method)
- result.encoding.should == Encoding::UTF_16BE
- result.should == "[utf_16be]".encode(Encoding::UTF_16BE)
+ lambda { [utf_16be].send(@method) }.should raise_error(Encoding::CompatibilityError)
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.