spec/spec_helper.rb in chatterbot-0.6.6 vs spec/spec_helper.rb in chatterbot-0.7.0
- old
+ new
@@ -41,10 +41,19 @@
:mentions => 1.upto(result_count).collect { |i| fake_tweet(i, id_base, true) }
}
)
end
+def fake_followers(count)
+ mock(Twitter::Client,
+ {
+ :credentials? => true,
+ :followers => 1.upto(count).collect { |i| fake_follower(i) }
+ }
+ )
+end
+
def fake_tweet(index, id=0, as_object = false)
id = index if id <= 0
x = {
:from_user => "chatterbot",
:index => index,
@@ -53,6 +62,10 @@
'screen_name' => "chatterbot"
}
}
as_object == true ? Twitter::Tweet.new(x) : x
+end
+
+def fake_follower(index=0)
+ Twitter::User.new(:id => index, :name => "Follower #{index}")
end