diff --git a/core/string/capitalize_spec.rb b/core/string/capitalize_spec.rb index e2d2b68caa..497e1453cd 100644 --- a/core/string/capitalize_spec.rb +++ b/core/string/capitalize_spec.rb @@ -44,6 +44,14 @@ a.should == "Hello" end + ruby_version_is '2.4' do + it "capitalizes self in place for all of Unicode" do + a = "äöü" + a.capitalize!.should equal(a) + a.should == "Äöü" + end + end + it "returns nil when no changes are made" do a = "Hello" a.capitalize!.should == nil diff --git a/core/string/downcase_spec.rb b/core/string/downcase_spec.rb index 9ebc4f2bd1..f591c0fa09 100644 --- a/core/string/downcase_spec.rb +++ b/core/string/downcase_spec.rb @@ -46,6 +46,14 @@ a.should == "hello" end + ruby_version_is '2.4' do + it "modifies self in place for all of Unicode" do + a = "ÄÖÜ" + a.downcase!.should equal(a) + a.should == "äöü" + end + end + it "returns nil if no modifications were made" do a = "hello" a.downcase!.should == nil diff --git a/core/string/swapcase_spec.rb b/core/string/swapcase_spec.rb index e9af647727..c2b583acab 100644 --- a/core/string/swapcase_spec.rb +++ b/core/string/swapcase_spec.rb @@ -41,6 +41,14 @@ a.should == "CyBeR_pUnK11" end + ruby_version_is '2.4' do + it "modifies self in place for all of Unicode" do + a = "äÖü" + a.swapcase!.should equal(a) + a.should == "ÄöÜ" + end + end + it "returns nil if no modifications were made" do a = "+++---111222???" a.swapcase!.should == nil diff --git a/core/string/upcase_spec.rb b/core/string/upcase_spec.rb index 2fdcce86b9..0094380664 100644 --- a/core/string/upcase_spec.rb +++ b/core/string/upcase_spec.rb @@ -46,6 +46,15 @@ a.should == "HELLO" end + + ruby_version_is '2.4' do + it "modifies self in place for all of Unicode" do + a = "äöü" + a.upcase!.should equal(a) + a.should == "ÄÖÜ" + end + end + it "returns nil if no modifications were made" do a = "HELLO" a.upcase!.should == nil