forked from ilyakatz/data-migrate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspec_helper.rb
34 lines (31 loc) · 809 Bytes
/
spec_helper.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
require 'rspec'
require 'rails'
require 'sqlite3'
require 'data_migrate'
require 'pry'
require 'timecop'
RSpec.configure do |config|
config.mock_with :rspec do |mocks|
mocks.verify_partial_doubles = true
end
config.after(:each) do
DataMigrate.configure do |config|
config.data_migrations_path = @prev_data_migrations_path
end
end
config.before(:each) do |example|
if example.metadata[:no_override]
else
@prev_data_migrations_path = DataMigrate.config.data_migrations_path
if Rails::VERSION::MAJOR == 5
DataMigrate.configure do |config|
config.data_migrations_path = "spec/db/data"
end
else
DataMigrate.configure do |config|
config.data_migrations_path = "spec/db/6.0"
end
end
end
end
end