forked from RedHatInsights/topological_inventory-sync
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
33 lines (26 loc) · 828 Bytes
/
Rakefile
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
begin
require 'bundler/setup'
rescue LoadError
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
end
require "rspec/core/rake_task"
require "active_record"
load "active_record/railties/databases.rake"
namespace :db do
task :environment do
require "topological_inventory/core/ar_helper"
TopologicalInventory::Core::ArHelper.database_yaml_path = Pathname.new(__dir__).join("config/database.yml")
TopologicalInventory::Core::ArHelper.load_environment!
end
Rake::Task["db:load_config"].enhance(["db:environment"])
end
# Spec related rake tasks
RSpec::Core::RakeTask.new(:spec)
namespace :spec do
task :initialize do
ENV["RAILS_ENV"] ||= "test"
end
desc "Setup the database for running tests"
task :setup => [:initialize, "db:test:prepare"]
end
task default: :spec