spec/spec_helper.rb in query_dam-0.0.1 vs spec/spec_helper.rb in query_dam-0.1.0

- old
+ new

@@ -1,5 +1,9 @@ +require 'query_dam' +require 'active_record' +require 'models/item' + RSpec.configure do |config| config.order = :random config.expect_with :rspec do |expectations| expectations.syntax = :expect @@ -8,5 +12,19 @@ config.mock_with :rspec do |mocks| mocks.syntax = :expect mocks.verify_partial_doubles = true end end + +ActiveRecord::Base.establish_connection( + adapter: 'sqlite3', + database: 'spec/testdb.sqlite3') + +ActiveRecord::Base.connection.execute 'drop table if exists items' +ActiveRecord::Base.connection.execute <<-SQL + create table items ( + id integer primary key, + name varchar(255), + quantity integer) +SQL + +Redis.current = Redis.new(host: '127.0.0.1', port: 6379)