disable RSpec monkeypatching.
This commit is contained in:
parent
ace44975d1
commit
79f8b8e6e9
|
@ -9,7 +9,7 @@ class FakeModel
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe DatabaseCleaner::ActiveRecord do
|
RSpec.describe DatabaseCleaner::ActiveRecord do
|
||||||
it { is_expected.to respond_to(:available_strategies) }
|
it { is_expected.to respond_to(:available_strategies) }
|
||||||
|
|
||||||
describe "config_file_location" do
|
describe "config_file_location" do
|
||||||
|
@ -32,7 +32,7 @@ module DatabaseCleaner
|
||||||
include DatabaseCleaner::ActiveRecord::Base
|
include DatabaseCleaner::ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
describe ExampleStrategy do
|
RSpec.describe ExampleStrategy do
|
||||||
let(:config_location) { '/path/to/config/database.yml' }
|
let(:config_location) { '/path/to/config/database.yml' }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
|
|
|
@ -4,7 +4,7 @@ require 'active_record'
|
||||||
module DatabaseCleaner
|
module DatabaseCleaner
|
||||||
module ActiveRecord
|
module ActiveRecord
|
||||||
|
|
||||||
describe Transaction do
|
RSpec.describe Transaction do
|
||||||
let (:connection) { double("connection") }
|
let (:connection) { double("connection") }
|
||||||
let (:connection_2) { double("connection") }
|
let (:connection_2) { double("connection") }
|
||||||
let (:connection_pool) { double("connection_pool")}
|
let (:connection_pool) { double("connection_pool")}
|
||||||
|
|
|
@ -3,7 +3,7 @@ require 'support/active_record/mysql2_setup'
|
||||||
require 'database_cleaner/active_record/truncation'
|
require 'database_cleaner/active_record/truncation'
|
||||||
require 'database_cleaner/active_record/truncation/shared_fast_truncation'
|
require 'database_cleaner/active_record/truncation/shared_fast_truncation'
|
||||||
|
|
||||||
describe DatabaseCleaner::ActiveRecord::Truncation do
|
RSpec.describe DatabaseCleaner::ActiveRecord::Truncation do
|
||||||
let(:helper) { MySQL2Helper.new }
|
let(:helper) { MySQL2Helper.new }
|
||||||
|
|
||||||
let(:connection) do
|
let(:connection) do
|
||||||
|
|
|
@ -3,7 +3,7 @@ require 'support/active_record/mysql_setup'
|
||||||
require 'database_cleaner/active_record/truncation'
|
require 'database_cleaner/active_record/truncation'
|
||||||
require 'database_cleaner/active_record/truncation/shared_fast_truncation'
|
require 'database_cleaner/active_record/truncation/shared_fast_truncation'
|
||||||
|
|
||||||
describe DatabaseCleaner::ActiveRecord::Truncation do
|
RSpec.describe DatabaseCleaner::ActiveRecord::Truncation do
|
||||||
let(:helper) { MySQLHelper.new }
|
let(:helper) { MySQLHelper.new }
|
||||||
|
|
||||||
let(:connection) do
|
let(:connection) do
|
||||||
|
|
|
@ -3,7 +3,7 @@ require 'support/active_record/postgresql_setup'
|
||||||
require 'database_cleaner/active_record/truncation'
|
require 'database_cleaner/active_record/truncation'
|
||||||
require 'database_cleaner/active_record/truncation/shared_fast_truncation'
|
require 'database_cleaner/active_record/truncation/shared_fast_truncation'
|
||||||
|
|
||||||
describe DatabaseCleaner::ActiveRecord::Truncation do
|
RSpec.describe DatabaseCleaner::ActiveRecord::Truncation do
|
||||||
let(:helper) { PostgreSQLHelper.new }
|
let(:helper) { PostgreSQLHelper.new }
|
||||||
|
|
||||||
let(:connection) do
|
let(:connection) do
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
shared_examples_for "an adapter with pre-count truncation" do
|
RSpec.shared_examples_for "an adapter with pre-count truncation" do
|
||||||
describe "#pre_count_truncate_tables" do
|
describe "#pre_count_truncate_tables" do
|
||||||
|
|
||||||
context "with :reset_ids set true" do
|
context "with :reset_ids set true" do
|
||||||
|
|
|
@ -2,7 +2,7 @@ require 'active_record'
|
||||||
require 'support/active_record/sqlite3_setup'
|
require 'support/active_record/sqlite3_setup'
|
||||||
require 'database_cleaner/active_record/truncation'
|
require 'database_cleaner/active_record/truncation'
|
||||||
|
|
||||||
describe DatabaseCleaner::ActiveRecord::Truncation do
|
RSpec.describe DatabaseCleaner::ActiveRecord::Truncation do
|
||||||
let(:helper) { SQLite3Helper.new }
|
let(:helper) { SQLite3Helper.new }
|
||||||
|
|
||||||
let(:connection) do
|
let(:connection) do
|
||||||
|
|
|
@ -10,7 +10,7 @@ module ActiveRecord
|
||||||
module ConnectionAdapters
|
module ConnectionAdapters
|
||||||
#JdbcAdapter IBM_DBAdapter
|
#JdbcAdapter IBM_DBAdapter
|
||||||
[ MysqlAdapter, Mysql2Adapter, SQLite3Adapter, PostgreSQLAdapter ].each do |adapter|
|
[ MysqlAdapter, Mysql2Adapter, SQLite3Adapter, PostgreSQLAdapter ].each do |adapter|
|
||||||
describe adapter, "#truncate_table" do
|
RSpec.describe adapter, "#truncate_table" do
|
||||||
it "responds" do
|
it "responds" do
|
||||||
expect(adapter.instance_methods).to include(:truncate_table)
|
expect(adapter.instance_methods).to include(:truncate_table)
|
||||||
end
|
end
|
||||||
|
@ -22,7 +22,7 @@ end
|
||||||
module DatabaseCleaner
|
module DatabaseCleaner
|
||||||
module ActiveRecord
|
module ActiveRecord
|
||||||
|
|
||||||
describe Truncation do
|
RSpec.describe Truncation do
|
||||||
let(:connection) { double('connection') }
|
let(:connection) { double('connection') }
|
||||||
|
|
||||||
before(:each) do
|
before(:each) do
|
||||||
|
|
|
@ -6,7 +6,7 @@ require 'database_cleaner/couch_potato/truncation'
|
||||||
require 'database_cleaner/neo4j/transaction'
|
require 'database_cleaner/neo4j/transaction'
|
||||||
|
|
||||||
module DatabaseCleaner
|
module DatabaseCleaner
|
||||||
describe Base do
|
RSpec.describe Base do
|
||||||
|
|
||||||
let(:mock_strategy) {
|
let(:mock_strategy) {
|
||||||
double("strategy").tap{|strategy|
|
double("strategy").tap{|strategy|
|
||||||
|
|
|
@ -20,7 +20,7 @@ module DatabaseCleaner
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe DatabaseCleaner do
|
RSpec.describe DatabaseCleaner do
|
||||||
before(:each) { DatabaseCleaner.reset }
|
before(:each) { DatabaseCleaner.reset }
|
||||||
|
|
||||||
context "orm specification" do
|
context "orm specification" do
|
||||||
|
|
|
@ -4,7 +4,7 @@ require 'couch_potato'
|
||||||
module DatabaseCleaner
|
module DatabaseCleaner
|
||||||
module CouchPotato
|
module CouchPotato
|
||||||
|
|
||||||
describe Truncation do
|
RSpec.describe Truncation do
|
||||||
let(:database) { double('database') }
|
let(:database) { double('database') }
|
||||||
|
|
||||||
before(:each) do
|
before(:each) do
|
||||||
|
|
|
@ -2,7 +2,7 @@ require 'database_cleaner/data_mapper/base'
|
||||||
require 'database_cleaner/shared_strategy'
|
require 'database_cleaner/shared_strategy'
|
||||||
|
|
||||||
module DatabaseCleaner
|
module DatabaseCleaner
|
||||||
describe DataMapper do
|
RSpec.describe DataMapper do
|
||||||
it { is_expected.to respond_to(:available_strategies) }
|
it { is_expected.to respond_to(:available_strategies) }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ module DatabaseCleaner
|
||||||
include ::DatabaseCleaner::DataMapper::Base
|
include ::DatabaseCleaner::DataMapper::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
describe ExampleStrategy do
|
RSpec.describe ExampleStrategy do
|
||||||
it_should_behave_like "a generic strategy"
|
it_should_behave_like "a generic strategy"
|
||||||
it { is_expected.to respond_to(:db) }
|
it { is_expected.to respond_to(:db) }
|
||||||
it { is_expected.to respond_to(:db=) }
|
it { is_expected.to respond_to(:db=) }
|
||||||
|
|
|
@ -5,7 +5,7 @@ require 'database_cleaner/shared_strategy'
|
||||||
module DatabaseCleaner
|
module DatabaseCleaner
|
||||||
module DataMapper
|
module DataMapper
|
||||||
|
|
||||||
describe Transaction do
|
RSpec.describe Transaction do
|
||||||
it_should_behave_like "a generic strategy"
|
it_should_behave_like "a generic strategy"
|
||||||
it_should_behave_like "a generic transaction strategy"
|
it_should_behave_like "a generic transaction strategy"
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ require 'dm-sqlite-adapter'
|
||||||
require 'support/data_mapper/sqlite3_setup'
|
require 'support/data_mapper/sqlite3_setup'
|
||||||
require 'database_cleaner/data_mapper/truncation'
|
require 'database_cleaner/data_mapper/truncation'
|
||||||
|
|
||||||
describe DatabaseCleaner::DataMapper::Truncation do
|
RSpec.describe DatabaseCleaner::DataMapper::Truncation do
|
||||||
let(:helper) { DataMapperSQLite3Helper.new }
|
let(:helper) { DataMapperSQLite3Helper.new }
|
||||||
|
|
||||||
let(:connection) do
|
let(:connection) do
|
||||||
|
|
|
@ -3,7 +3,7 @@ require 'database_cleaner/shared_strategy'
|
||||||
|
|
||||||
module DatabaseCleaner
|
module DatabaseCleaner
|
||||||
module DataMapper
|
module DataMapper
|
||||||
describe Truncation do
|
RSpec.describe Truncation do
|
||||||
it_should_behave_like "a generic strategy"
|
it_should_behave_like "a generic strategy"
|
||||||
it_should_behave_like "a generic truncation strategy"
|
it_should_behave_like "a generic truncation strategy"
|
||||||
end
|
end
|
||||||
|
|
|
@ -10,7 +10,7 @@ module ::DatabaseCleaner
|
||||||
def start; end
|
def start; end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe ExampleStrategy do
|
RSpec.describe ExampleStrategy do
|
||||||
context "class methods" do
|
context "class methods" do
|
||||||
subject { ExampleStrategy }
|
subject { ExampleStrategy }
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ module ::DatabaseCleaner
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe TruncationExample do
|
RSpec.describe TruncationExample do
|
||||||
subject(:truncation_example) { TruncationExample.new }
|
subject(:truncation_example) { TruncationExample.new }
|
||||||
|
|
||||||
it "will start" do
|
it "will start" do
|
||||||
|
|
|
@ -2,7 +2,7 @@ require 'mongo'
|
||||||
require 'database_cleaner/mongo/truncation'
|
require 'database_cleaner/mongo/truncation'
|
||||||
require File.dirname(__FILE__) + '/mongo_examples'
|
require File.dirname(__FILE__) + '/mongo_examples'
|
||||||
|
|
||||||
describe DatabaseCleaner::Mongo::Truncation do
|
RSpec.describe DatabaseCleaner::Mongo::Truncation do
|
||||||
around do |example|
|
around do |example|
|
||||||
connection = Mongo::Connection.new('127.0.0.1')
|
connection = Mongo::Connection.new('127.0.0.1')
|
||||||
db_name = 'database_cleaner_specs'
|
db_name = 'database_cleaner_specs'
|
||||||
|
|
|
@ -2,7 +2,7 @@ require 'database_cleaner/mongo_mapper/base'
|
||||||
require 'database_cleaner/shared_strategy'
|
require 'database_cleaner/shared_strategy'
|
||||||
|
|
||||||
module DatabaseCleaner
|
module DatabaseCleaner
|
||||||
describe MongoMapper do
|
RSpec.describe MongoMapper do
|
||||||
it { is_expected.to respond_to(:available_strategies) }
|
it { is_expected.to respond_to(:available_strategies) }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ module DatabaseCleaner
|
||||||
include ::DatabaseCleaner::MongoMapper::Base
|
include ::DatabaseCleaner::MongoMapper::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
describe ExampleStrategy do
|
RSpec.describe ExampleStrategy do
|
||||||
|
|
||||||
it_should_behave_like "a generic strategy"
|
it_should_behave_like "a generic strategy"
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ require 'mongo_mapper'
|
||||||
require 'database_cleaner/mongo_mapper/truncation'
|
require 'database_cleaner/mongo_mapper/truncation'
|
||||||
require File.dirname(__FILE__) + '/mongo_examples'
|
require File.dirname(__FILE__) + '/mongo_examples'
|
||||||
|
|
||||||
describe DatabaseCleaner::MongoMapper::Truncation do
|
RSpec.describe DatabaseCleaner::MongoMapper::Truncation do
|
||||||
around do |example|
|
around do |example|
|
||||||
MongoMapper.connection = Mongo::Connection.new('127.0.0.1')
|
MongoMapper.connection = Mongo::Connection.new('127.0.0.1')
|
||||||
db_name = 'database_cleaner_specs'
|
db_name = 'database_cleaner_specs'
|
||||||
|
|
|
@ -2,7 +2,7 @@ require 'moped'
|
||||||
require 'database_cleaner/moped/truncation'
|
require 'database_cleaner/moped/truncation'
|
||||||
require File.dirname(__FILE__) + '/moped_examples'
|
require File.dirname(__FILE__) + '/moped_examples'
|
||||||
|
|
||||||
describe DatabaseCleaner::Moped::Truncation do
|
RSpec.describe DatabaseCleaner::Moped::Truncation do
|
||||||
around do |example|
|
around do |example|
|
||||||
db_name = 'database_cleaner_specs'
|
db_name = 'database_cleaner_specs'
|
||||||
session = ::Moped::Session.new(['127.0.0.1:27017'], database: db_name)
|
session = ::Moped::Session.new(['127.0.0.1:27017'], database: db_name)
|
||||||
|
|
|
@ -2,7 +2,7 @@ require 'database_cleaner/neo4j/base'
|
||||||
require 'database_cleaner/shared_strategy'
|
require 'database_cleaner/shared_strategy'
|
||||||
|
|
||||||
module DatabaseCleaner
|
module DatabaseCleaner
|
||||||
describe Neo4j do
|
RSpec.describe Neo4j do
|
||||||
it { is_expected.to respond_to(:available_strategies) }
|
it { is_expected.to respond_to(:available_strategies) }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ module DatabaseCleaner
|
||||||
include ::DatabaseCleaner::Neo4j::Base
|
include ::DatabaseCleaner::Neo4j::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
describe ExampleStrategy do
|
RSpec.describe ExampleStrategy do
|
||||||
|
|
||||||
it_should_behave_like "a generic strategy"
|
it_should_behave_like "a generic strategy"
|
||||||
it { is_expected.to respond_to(:db) }
|
it { is_expected.to respond_to(:db) }
|
||||||
|
|
|
@ -5,7 +5,7 @@ require 'database_cleaner/shared_strategy'
|
||||||
module DatabaseCleaner
|
module DatabaseCleaner
|
||||||
module Neo4j
|
module Neo4j
|
||||||
|
|
||||||
describe Transaction do
|
RSpec.describe Transaction do
|
||||||
before(:all) do
|
before(:all) do
|
||||||
DatabaseCleaner[:neo4j, :connection => {:type => :server_db, :path => 'http://localhost:7474'}]
|
DatabaseCleaner[:neo4j, :connection => {:type => :server_db, :path => 'http://localhost:7474'}]
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
require "database_cleaner/null_strategy"
|
require "database_cleaner/null_strategy"
|
||||||
|
|
||||||
module DatabaseCleaner
|
module DatabaseCleaner
|
||||||
describe NullStrategy do
|
RSpec.describe NullStrategy do
|
||||||
it 'responds to .start' do
|
it 'responds to .start' do
|
||||||
expect { NullStrategy.start }.not_to raise_error
|
expect { NullStrategy.start }.not_to raise_error
|
||||||
end
|
end
|
||||||
|
|
|
@ -11,7 +11,7 @@ module OhmTests
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe DatabaseCleaner::Ohm::Truncation do
|
RSpec.describe DatabaseCleaner::Ohm::Truncation do
|
||||||
around do |example|
|
around do |example|
|
||||||
config = YAML::load(File.open("#{File.dirname(__FILE__)}/../../../examples/config/redis.yml"))
|
config = YAML::load(File.open("#{File.dirname(__FILE__)}/../../../examples/config/redis.yml"))
|
||||||
Ohm.connect url: config['test']['url']
|
Ohm.connect url: config['test']['url']
|
||||||
|
|
|
@ -3,7 +3,7 @@ require 'database_cleaner/redis/base'
|
||||||
require 'database_cleaner/shared_strategy'
|
require 'database_cleaner/shared_strategy'
|
||||||
|
|
||||||
module DatabaseCleaner
|
module DatabaseCleaner
|
||||||
describe Redis do
|
RSpec.describe Redis do
|
||||||
it { is_expected.to respond_to(:available_strategies) }
|
it { is_expected.to respond_to(:available_strategies) }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ module DatabaseCleaner
|
||||||
include ::DatabaseCleaner::Redis::Base
|
include ::DatabaseCleaner::Redis::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
describe ExampleStrategy do
|
RSpec.describe ExampleStrategy do
|
||||||
|
|
||||||
it_should_behave_like "a generic strategy"
|
it_should_behave_like "a generic strategy"
|
||||||
it { is_expected.to respond_to(:db) }
|
it { is_expected.to respond_to(:db) }
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
require 'redis'
|
require 'redis'
|
||||||
require 'database_cleaner/redis/truncation'
|
require 'database_cleaner/redis/truncation'
|
||||||
|
|
||||||
describe DatabaseCleaner::Redis::Truncation do
|
RSpec.describe DatabaseCleaner::Redis::Truncation do
|
||||||
around do |example|
|
around do |example|
|
||||||
config = YAML::load(File.open("#{File.dirname(__FILE__)}/../../../examples/config/redis.yml"))
|
config = YAML::load(File.open("#{File.dirname(__FILE__)}/../../../examples/config/redis.yml"))
|
||||||
@redis = ::Redis.new :url => config['test']['url']
|
@redis = ::Redis.new :url => config['test']['url']
|
||||||
|
|
|
@ -2,7 +2,7 @@ require 'active_record'
|
||||||
require 'database_cleaner/active_record/transaction'
|
require 'database_cleaner/active_record/transaction'
|
||||||
|
|
||||||
module DatabaseCleaner
|
module DatabaseCleaner
|
||||||
describe Safeguard do
|
RSpec.describe Safeguard do
|
||||||
let(:strategy) { DatabaseCleaner::ActiveRecord::Transaction }
|
let(:strategy) { DatabaseCleaner::ActiveRecord::Transaction }
|
||||||
let(:cleaner) { Base.new(:autodetect) }
|
let(:cleaner) { Base.new(:autodetect) }
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ require 'database_cleaner/shared_strategy'
|
||||||
require 'sequel'
|
require 'sequel'
|
||||||
|
|
||||||
module DatabaseCleaner
|
module DatabaseCleaner
|
||||||
describe Sequel do
|
RSpec.describe Sequel do
|
||||||
it { is_expected.to respond_to(:available_strategies) }
|
it { is_expected.to respond_to(:available_strategies) }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ module DatabaseCleaner
|
||||||
include ::DatabaseCleaner::Sequel::Base
|
include ::DatabaseCleaner::Sequel::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
describe ExampleStrategy do
|
RSpec.describe ExampleStrategy do
|
||||||
it_should_behave_like "a generic strategy"
|
it_should_behave_like "a generic strategy"
|
||||||
it { is_expected.to respond_to(:db) }
|
it { is_expected.to respond_to(:db) }
|
||||||
it { is_expected.to respond_to(:db=) }
|
it { is_expected.to respond_to(:db=) }
|
||||||
|
|
|
@ -7,11 +7,11 @@ require 'support/active_record/database_setup'
|
||||||
|
|
||||||
module DatabaseCleaner
|
module DatabaseCleaner
|
||||||
module Sequel
|
module Sequel
|
||||||
describe Deletion do
|
RSpec.describe Deletion do
|
||||||
it_should_behave_like "a generic strategy"
|
it_should_behave_like "a generic strategy"
|
||||||
end
|
end
|
||||||
|
|
||||||
shared_examples 'a Sequel deletion strategy' do
|
RSpec.shared_examples 'a Sequel deletion strategy' do
|
||||||
let(:deletion) do
|
let(:deletion) do
|
||||||
d = Deletion.new
|
d = Deletion.new
|
||||||
d.db = db
|
d.db = db
|
||||||
|
@ -49,7 +49,7 @@ module DatabaseCleaner
|
||||||
]
|
]
|
||||||
|
|
||||||
supported_configurations.each do |config|
|
supported_configurations.each do |config|
|
||||||
describe "Sequel deletion (using a #{config[:url]} connection)" do
|
RSpec.describe "Sequel deletion (using a #{config[:url]} connection)" do
|
||||||
let(:db) { ::Sequel.connect(config[:url], config[:connection_options]) }
|
let(:db) { ::Sequel.connect(config[:url], config[:connection_options]) }
|
||||||
|
|
||||||
around do |example|
|
around do |example|
|
||||||
|
|
|
@ -4,7 +4,7 @@ require 'sequel'
|
||||||
|
|
||||||
module DatabaseCleaner
|
module DatabaseCleaner
|
||||||
module Sequel
|
module Sequel
|
||||||
describe Transaction do
|
RSpec.describe Transaction do
|
||||||
it_should_behave_like "a generic strategy"
|
it_should_behave_like "a generic strategy"
|
||||||
it_should_behave_like "a generic transaction strategy"
|
it_should_behave_like "a generic transaction strategy"
|
||||||
|
|
||||||
|
|
|
@ -7,12 +7,12 @@ require 'support/active_record/database_setup'
|
||||||
|
|
||||||
module DatabaseCleaner
|
module DatabaseCleaner
|
||||||
module Sequel
|
module Sequel
|
||||||
describe Truncation do
|
RSpec.describe Truncation do
|
||||||
it_should_behave_like "a generic strategy"
|
it_should_behave_like "a generic strategy"
|
||||||
it_should_behave_like "a generic truncation strategy"
|
it_should_behave_like "a generic truncation strategy"
|
||||||
end
|
end
|
||||||
|
|
||||||
shared_examples 'a Sequel truncation strategy' do
|
RSpec.shared_examples 'a Sequel truncation strategy' do
|
||||||
|
|
||||||
# XXX: it'd be really nice if Truncation accepted db: constructor parameter
|
# XXX: it'd be really nice if Truncation accepted db: constructor parameter
|
||||||
let(:truncation) do
|
let(:truncation) do
|
||||||
|
@ -67,7 +67,7 @@ module DatabaseCleaner
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
shared_examples_for 'a truncation strategy without autoincrement resets' do
|
RSpec.shared_examples_for 'a truncation strategy without autoincrement resets' do
|
||||||
it "leaves AUTO_INCREMENT index alone by default (BUG: it should be reset instead)" do
|
it "leaves AUTO_INCREMENT index alone by default (BUG: it should be reset instead)" do
|
||||||
pending
|
pending
|
||||||
# Jordan Hollinger made everything reset auto increment IDs
|
# Jordan Hollinger made everything reset auto increment IDs
|
||||||
|
@ -94,7 +94,7 @@ module DatabaseCleaner
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
shared_examples_for 'a truncation strategy that resets autoincrement keys by default' do
|
RSpec.shared_examples_for 'a truncation strategy that resets autoincrement keys by default' do
|
||||||
it "resets AUTO_INCREMENT primary keys" do
|
it "resets AUTO_INCREMENT primary keys" do
|
||||||
db.create_table!(:replaceable_trifles) { primary_key :id }
|
db.create_table!(:replaceable_trifles) { primary_key :id }
|
||||||
table = db[:replaceable_trifles]
|
table = db[:replaceable_trifles]
|
||||||
|
@ -124,7 +124,7 @@ module DatabaseCleaner
|
||||||
]
|
]
|
||||||
|
|
||||||
supported_configurations.each do |config|
|
supported_configurations.each do |config|
|
||||||
describe "Sequel truncation (using a #{config[:url]} connection)" do
|
RSpec.describe "Sequel truncation (using a #{config[:url]} connection)" do
|
||||||
around do |example|
|
around do |example|
|
||||||
helper = SequelHelper.new(config)
|
helper = SequelHelper.new(config)
|
||||||
helper.setup
|
helper.setup
|
||||||
|
@ -183,7 +183,7 @@ module DatabaseCleaner
|
||||||
end
|
end
|
||||||
|
|
||||||
half_supported_configurations.each do |config|
|
half_supported_configurations.each do |config|
|
||||||
describe "Sequel truncation (using a #{config[:url]} connection)" do
|
RSpec.describe "Sequel truncation (using a #{config[:url]} connection)" do
|
||||||
around do |example|
|
around do |example|
|
||||||
helper = SequelHelper.new(config)
|
helper = SequelHelper.new(config)
|
||||||
helper.setup
|
helper.setup
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
shared_examples_for "a generic strategy" do
|
RSpec.shared_examples_for "a generic strategy" do
|
||||||
it { is_expected.to respond_to(:db) }
|
it { is_expected.to respond_to(:db) }
|
||||||
end
|
end
|
||||||
|
|
||||||
shared_examples_for "a generic truncation strategy" do
|
RSpec.shared_examples_for "a generic truncation strategy" do
|
||||||
it { is_expected.to respond_to(:start) }
|
it { is_expected.to respond_to(:start) }
|
||||||
it { is_expected.to respond_to(:clean) }
|
it { is_expected.to respond_to(:clean) }
|
||||||
it { is_expected.to respond_to(:cleaning) }
|
it { is_expected.to respond_to(:cleaning) }
|
||||||
end
|
end
|
||||||
|
|
||||||
shared_examples_for "a generic transaction strategy" do
|
RSpec.shared_examples_for "a generic transaction strategy" do
|
||||||
it { is_expected.to respond_to(:start) }
|
it { is_expected.to respond_to(:start) }
|
||||||
it { is_expected.to respond_to(:clean) }
|
it { is_expected.to respond_to(:clean) }
|
||||||
it { is_expected.to respond_to(:cleaning) }
|
it { is_expected.to respond_to(:cleaning) }
|
||||||
|
|
|
@ -8,5 +8,7 @@ RSpec.configure do |config|
|
||||||
# get run.
|
# get run.
|
||||||
config.filter_run :focus
|
config.filter_run :focus
|
||||||
config.run_all_when_everything_filtered = true
|
config.run_all_when_everything_filtered = true
|
||||||
|
|
||||||
|
config.disable_monkey_patching!
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue