spec/spec_helper.rb in chatterbot-0.7.0 vs spec/spec_helper.rb in chatterbot-0.7.1
- old
+ new
@@ -19,34 +19,34 @@
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
def test_bot
bot = Chatterbot::Bot.new
- bot.stub!(:load_config).and_return({})
- bot.stub!(:update_config_at_exit)
+ bot.stub(:load_config).and_return({})
+ bot.stub(:update_config_at_exit)
bot
end
def fake_search(max_id = 100, result_count = 0, id_base=0)
- mock(Twitter::Client,
+ double(Twitter::Client,
:credentials? => true,
:search => Twitter::SearchResults.new(:search_metadata => {:max_id => max_id},
:statuses => 1.upto(result_count).collect { |i| fake_tweet(i, id_base) } )
)
end
-def fake_replies(max_id = 100, result_count = 0, id_base = 0)
- mock(Twitter::Client,
+def fake_replies(result_count = 0, id_base = 0)
+ double(Twitter::Client,
{
:credentials? => true,
:mentions => 1.upto(result_count).collect { |i| fake_tweet(i, id_base, true) }
}
)
end
def fake_followers(count)
- mock(Twitter::Client,
+ double(Twitter::Client,
{
:credentials? => true,
:followers => 1.upto(count).collect { |i| fake_follower(i) }
}
)
@@ -67,5 +67,6 @@
end
def fake_follower(index=0)
Twitter::User.new(:id => index, :name => "Follower #{index}")
end
+