spec/config_spec.rb in chatterbot-0.6.3 vs spec/config_spec.rb in chatterbot-0.6.5

- old
+ new

@@ -132,12 +132,10 @@ end end describe "update_since_id" do it "works with searches" do -# data = [ fake_tweet(1000) ] - data = fake_search(1000, 1).search @bot.config[:tmp_since_id] = 100 @bot.update_since_id(data) @bot.config[:tmp_since_id].should == 1000 @@ -149,9 +147,22 @@ data = fake_tweet(1000, 1000, true) @bot.update_since_id(data) @bot.config[:tmp_since_id].should == 1000 end + it "works with arrays" do + @bot.config[:tmp_since_id] = 100 + + data = [ + fake_tweet(500, 1000, true), + fake_tweet(1000, 1000, true), + fake_tweet(400, 1000, true) + ] + + @bot.update_since_id(data) + @bot.config[:tmp_since_id].should == 1000 + end + it "never rolls back" do @bot.config[:tmp_since_id] = 100 data = fake_tweet(50, 50, true) @bot.update_since_id(data) @bot.config[:tmp_since_id].should == 100