-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspec_helper.rb
35 lines (26 loc) · 885 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
35
# frozen_string_literal: true
require "bundler/setup"
require "rails/generators"
require "active_record"
require "generator_spec"
require "lite/uxid"
Lite::Uxid.reset_configuration!
spec_path = Pathname.new(File.expand_path("../spec", File.dirname(__FILE__)))
%w[config models].each do |dir|
Dir.each_child(spec_path.join("support/#{dir}")) do |f|
load(spec_path.join("support/#{dir}/#{f}"))
end
end
RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure
config.example_status_persistence_file_path = ".rspec_status"
# Disable RSpec exposing methods globally on `Module` and `main`
config.disable_monkey_patching!
config.expect_with :rspec do |c|
c.syntax = :expect
end
config.after(:all) do
temp_path = spec_path.join("generators/lite/tmp")
FileUtils.remove_dir(temp_path) if File.directory?(temp_path)
end
end