summaryrefslogtreecommitdiff
path: root/spec/ruby/core/string/strip_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/string/strip_spec.rb')
-rw-r--r--spec/ruby/core/string/strip_spec.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/ruby/core/string/strip_spec.rb b/spec/ruby/core/string/strip_spec.rb
index e841db54ce..662f13b032 100644
--- a/spec/ruby/core/string/strip_spec.rb
+++ b/spec/ruby/core/string/strip_spec.rb
@@ -35,6 +35,12 @@ describe "String#strip!" do
a.should == "hello"
end
+ it "makes a string empty if it is only whitespace" do
+ "".strip!.should == nil
+ " ".strip.should == ""
+ " ".strip.should == ""
+ end
+
ruby_version_is '3.0' do
it "removes leading and trailing NULL bytes and whitespace" do
a = "\000 goodbye \000"