diff options
author | duerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-19 08:05:56 +0000 |
---|---|---|
committer | duerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-19 08:05:56 +0000 |
commit | 0cbe2cfd6516da15fb5414a4fbadbe305237a7ad (patch) | |
tree | 4c294e0e1410a3acec8b2ebaeb34b72b11893fc6 /spec | |
parent | 37da94857a2cdc42ac213cd9760adba82ef883ba (diff) | |
download | ruby-0cbe2cfd6516da15fb5414a4fbadbe305237a7ad.tar.gz |
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
Diffstat (limited to 'spec')
-rw-r--r-- | spec/rubyspec/core/string/unicode_normalize_spec.rb | 19 |
1 files 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 |