From 0cbe2cfd6516da15fb5414a4fbadbe305237a7ad Mon Sep 17 00:00:00 2001 From: duerst Date: Fri, 19 May 2017 08:05:56 +0000 Subject: [PATCH] improve examples, fix one improbably should_not value git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- .../core/string/unicode_normalize_spec.rb | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/spec/rubyspec/core/string/unicode_normalize_spec.rb b/spec/rubyspec/core/string/unicode_normalize_spec.rb index ab7c0e3618..138c0455fd 100644 --- a/spec/rubyspec/core/string/unicode_normalize_spec.rb +++ b/spec/rubyspec/core/string/unicode_normalize_spec.rb @@ -80,30 +80,29 @@ describe "String#unicode_normalize!" do str = "\u00E0" str.unicode_normalize!(:nfd) - str.should_not == "a\u00E0" - str.should == "à" + str.should_not == "\u00E0" + str.should == "a\u0300" end it "modifies self in place (nfkc)" do - str = "a\u0300" + str = "\u1E9B\u0323" str.unicode_normalize!(:nfkc) - str.should_not == "a\u0300" - str.should == "à" + str.should_not == "\u1E9B\u0323" + str.should == "\u1E69" end it "modifies self in place (nfkd)" do - str = "\u00E0" + str = "\u1E9B\u0323" str.unicode_normalize!(:nfkd) - str.should_not == "a\u00E0" - str.should == "à" + str.should_not == "\u1E9B\u0323" + str.should == "s\u0323\u0307" end it "raises an Encoding::CompatibilityError if the string is not in an unicode encoding" do - ohm = "\u2126" lambda { - ohm.force_encoding("ISO-8859-1").unicode_normalize! + [0xE0].pack('C').force_encoding("ISO-8859-1").unicode_normalize! }.should raise_error(Encoding::CompatibilityError) end