Skip to content

Commit

Permalink
Fix lstrip and rstrip spec in spec/core
Browse files Browse the repository at this point in the history
  • Loading branch information
spastorino committed Feb 5, 2011
1 parent 294aca4 commit 93539aa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions spec/core/string/lstrip_spec.rb
Expand Up @@ -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
6 changes: 3 additions & 3 deletions spec/core/string/rstrip_spec.rb
Expand Up @@ -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.