Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix lstrip and rstrip spec in spec/core

  • Loading branch information...
commit 93539aae5f19b7ee78ef223c45da98cd37f24d70 1 parent 294aca4
@spastorino spastorino authored
View
8 spec/core/string/lstrip_spec.rb
@@ -4,14 +4,14 @@
it "returns a string with all leading \\000 and whitespace characters removed" do
"".lstrip.should == ""
" hello ".lstrip.should == "hello "
- "\000 hello ".lstrip.should == "hello "
- "\000\t \000hello ".lstrip.should == "hello "
+ "\000 hello ".lstrip.should == "\000 hello "
+ "\000\t \000hello ".lstrip.should == "\000\t \000hello "
"hello".lstrip.should == "hello"
end
it "modifies self by removing all leading \\000 and whitespace characters" do
"\n\t This \000".lstrip!.should == "This \000"
- "\000 another one".lstrip!.should == "another one"
- "\000 \000\t\v\000two ".lstrip!.should == "two "
+ "\000 another one".lstrip!.should == nil
+ "\000 \000\t\v\000two ".lstrip!.should == nil
end
end
View
6 spec/core/string/rstrip_spec.rb
@@ -8,15 +8,15 @@
" hello ".rstrip.rstrip.should == " hello"
"\tgoodbye\r\n".rstrip.rstrip.should == "\tgoodbye"
"goodbye \000".rstrip.rstrip.should == "goodbye"
- "goodbye \000\t \f \000".rstrip.rstrip.should == "goodbye"
+ "goodbye \000\t \f \000".rstrip.rstrip.should == "goodbye"
end
it "modifies self by removing all trailing \\000 and whitespace characters" do
" hello ".rstrip!.should == " hello"
"\tgoodbye\r\n".rstrip!.should == "\tgoodbye"
"goodbye \000".rstrip!.should == "goodbye"
- "goodbye \000 ".rstrip!.should == "goodbye"
+ "goodbye \000 ".rstrip!.should == "goodbye \000"
"".rstrip!.should == nil
- " \n \000\v\000".rstrip!.should == ""
+ " \n \000\v\000".rstrip!.should == " \n \000"
end
end

0 comments on commit 93539aa

Please sign in to comment.
Something went wrong with that request. Please try again.