Permalink
Browse files

String representation of Client::Redditor is Reddit username

  • Loading branch information...
1 parent d2faf61 commit 4c2920a409c9935b7070f672c4b93f86826a6ee5 @mdippery committed Dec 25, 2012
Showing with 10 additions and 0 deletions.
  1. +4 −0 lib/usaidwat/client.rb
  2. +6 −0 spec/usaidwat/client_spec.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") }
@@ -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!

0 comments on commit 4c2920a

Please sign in to comment.