Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

String representation of Client::Redditor is Reddit username

  • Loading branch information...
commit 4c2920a409c9935b7070f672c4b93f86826a6ee5 1 parent d2faf61
@mdippery authored
Showing with 10 additions and 0 deletions.
  1. +4 −0 lib/usaidwat/client.rb
  2. +6 −0 spec/usaidwat/client_spec.rb
View
4 lib/usaidwat/client.rb
@@ -19,6 +19,10 @@ def comments
raise ReachabilityError, "Reddit unreachable"
end
+ def to_s
+ "#{username}"
+ end
+
private
def enable_test_urls
Snooby::Paths.each { |k,v| Snooby::Paths[k] = v.sub(%r{http://www.reddit.com}, "http://localhost:4567") }
View
6 spec/usaidwat/client_spec.rb
@@ -11,6 +11,12 @@ module Client
end
end
+ describe "#to_s" do
+ it "returns a string representing the Redditor" do
+ "#{redditor}".should == "mipadi"
+ end
+ end
+
context "when Reddit is up" do
before(:each) do
WebMock.disable_net_connect!
Please sign in to comment.
Something went wrong with that request. Please try again.