goldiloader 0.0.11 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.
data/spec/spec_helper.rb DELETED
@@ -1,50 +0,0 @@
1
- # encoding: UTF-8
2
-
3
- require 'simplecov'
4
- require 'coveralls'
5
-
6
- SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
7
- SimpleCov::Formatter::HTMLFormatter,
8
- Coveralls::SimpleCov::Formatter
9
- ]
10
- SimpleCov.start do
11
- add_filter 'spec'
12
- end
13
-
14
- require 'logger'
15
- require 'database_cleaner'
16
- require 'goldiloader'
17
- require 'yaml'
18
-
19
- FileUtils.makedirs('log')
20
-
21
- ActiveRecord::Base.logger = Logger.new('log/test.log')
22
- ActiveRecord::Base.logger.level = Logger::DEBUG
23
- ActiveRecord::Migration.verbose = false
24
-
25
- db_adapter = ENV.fetch('ADAPTER', 'sqlite3')
26
- config = YAML.load(File.read('spec/db/database.yml'))
27
- ActiveRecord::Base.establish_connection(config[db_adapter])
28
- require 'db/schema'
29
-
30
- RSpec.configure do |config|
31
- config.order = 'random'
32
-
33
- config.before(:suite) do
34
- DatabaseCleaner.clean_with(:truncation)
35
- end
36
-
37
- config.before(:each) do
38
- DatabaseCleaner.strategy = :transaction
39
- end
40
-
41
- config.before(:each) do
42
- DatabaseCleaner.start
43
- end
44
-
45
- config.after(:each) do
46
- DatabaseCleaner.clean
47
- end
48
- end
49
-
50
- puts "Testing with ActiveRecord #{ActiveRecord::VERSION::STRING}"