spec/db_spec.rb in chatterbot-0.7.1 vs spec/db_spec.rb in chatterbot-0.9.0
- old
+ new
@@ -9,23 +9,23 @@
end
context "prerequisites" do
describe "get_connection" do
it "should make sure sequel is actually installed" do
- Chatterbot::Bot.any_instance.stub(:has_sequel?) { false }
+ allow_any_instance_of(Chatterbot::Bot).to receive(:has_sequel?) { false }
@bot = Chatterbot::Bot.new
@bot.config[:db_uri] = @db_uri
- @bot.should_receive(:display_db_config_notice)
+ expect(@bot).to receive(:display_db_config_notice)
@bot.db
end
end
end
context "db interactions" do
before(:each) do
@bot = Chatterbot::Bot.new
- @bot.stub(:update_config_at_exit)
+ allow(@bot).to receive(:update_config_at_exit)
@bot.config[:db_uri] = @db_uri
end
after(:each) do
@bot.db.disconnect unless @bot.db.nil?
@@ -33,21 +33,21 @@
describe "table creation" do
[:blacklist, :tweets, :config].each do |table|
it "should create table #{table}" do
@tmp_conn = @bot.db
- @tmp_conn.tables.include?(table).should == true
+ expect(@tmp_conn.tables.include?(table)).to eq(true)
end
end
end
describe "store_database_config" do
it "doesn't fail" do
@bot = Chatterbot::Bot.new
@bot.config[:db_uri] = @db_uri
@bot.db
- @bot.store_database_config.should == true
+ expect(@bot.store_database_config).to eq(true)
end
end
end
end