Skip to content

Commit

Permalink
removed unused core extension String#ends_with?
Browse files Browse the repository at this point in the history
  • Loading branch information
rubiii committed Jan 8, 2011
1 parent 3ed7e7d commit 26b4eae
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
6 changes: 0 additions & 6 deletions lib/savon/core_ext/string.rb
Expand Up @@ -31,12 +31,6 @@ def starts_with?(prefix)
self[0, prefix.length] == prefix
end unless defined? starts_with?

# Returns whether the String ends with a given +suffix+.
def ends_with?(suffix)
suffix = suffix.to_s
self[-suffix.length, suffix.length] == suffix
end unless defined? ends_with?

# Returns the String without namespace.
def strip_namespace
split(":").last
Expand Down
8 changes: 0 additions & 8 deletions spec/savon/core_ext/string_spec.rb
Expand Up @@ -25,14 +25,6 @@
end
end

describe "ends_with?" do
it "should return whether it ends with a given suffix" do
"authenticate!".ends_with?("!").should be_true
"authenticate".ends_with?("cate").should be_true
"authenticate".ends_with?("?").should be_false
end
end

describe "strip_namespace" do
it "strips the namespace from a namespaced String" do
"ns:customer".strip_namespace.should == "customer"
Expand Down

0 comments on commit 26b4eae

Please sign in to comment.