spec/tweet_spec.rb in chatterbot-0.7.0 vs spec/tweet_spec.rb in chatterbot-0.7.1
- old
+ new
@@ -13,26 +13,26 @@
it "calls client.update with the right values" do
bot = test_bot
bot.should_receive(:require_login).and_return(true)
- bot.stub!(:client).and_return(mock(Twitter::Client))
+ bot.stub(:client).and_return(double(Twitter::Client))
- bot.stub!(:debug_mode?).and_return(false)
+ bot.stub(:debug_mode?).and_return(false)
test_str = "test!"
bot.client.should_receive(:update).with(test_str, {})
bot.tweet test_str
end
it "doesn't tweet when debug_mode? is set" do
bot = test_bot
bot.should_receive(:require_login).and_return(true)
- bot.stub!(:client).and_return(mock(Twitter::Client))
+ bot.stub(:client).and_return(double(Twitter::Client))
- bot.stub!(:debug_mode?).and_return(true)
+ bot.stub(:debug_mode?).and_return(true)
bot.client.should_not_receive(:update)
bot.tweet "no tweet!"
end
end
@@ -45,13 +45,13 @@
end
it "calls client.update with the right values" do
bot = test_bot
bot.should_receive(:require_login).and_return(true)
- bot.stub!(:client).and_return(mock(Twitter::Client))
+ bot.stub(:client).and_return(double(Twitter::Client))
- bot.stub!(:debug_mode?).and_return(false)
+ bot.stub(:debug_mode?).and_return(false)
test_str = "test!"
s = {
:id => 100
@@ -62,12 +62,12 @@
it "doesn't reply when debug_mode? is set" do
bot = test_bot
bot.should_receive(:require_login).and_return(true)
- bot.stub!(:client).and_return(mock(Twitter::Client))
+ bot.stub(:client).and_return(double(Twitter::Client))
- bot.stub!(:debug_mode?).and_return(true)
+ bot.stub(:debug_mode?).and_return(true)
bot.client.should_not_receive(:update)
bot.reply "no reply test!", {:id => 100}
end
end