forked from westonganger/active_snapshot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
54 lines (40 loc) · 1.24 KB
/
Rakefile
File metadata and controls
54 lines (40 loc) · 1.24 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
require File.expand_path(File.dirname(__FILE__) + '/lib/active_snapshot/version.rb')
require "bundler/gem_tasks"
require "rake/testtask"
Rake::TestTask.new(:test) do |t|
t.libs << "test"
t.libs << "lib"
t.test_files = FileList["test/**/*_test.rb"]
end
task :db_prepare do
# if ENV['CI'] != "true"
# begin
# require 'pg'
# ### FOR LOCAL TESTING
# `dropdb active_snapshot_test && createdb active_snapshot_test` rescue true
# rescue LoadError
# # Do nothing
# end
# end
### RUN GENERATOR
# Dir.chdir("test/dummy_app") do
# ### Instantiates Rails
# require File.expand_path("test/dummy_app/config/environment.rb", __dir__)
# migration_path = "db/migrate"
# ### Generate Migration
# require "generators/active_snapshot/install/install_generator"
# generator = ActiveSnapshot::InstallGenerator.new
# Dir.glob(Rails.root.join(migration_path, "*#{generator.class::MIGRATION_NAME}.rb")).each do |f|
# FileUtils.rm(f)
# end
# generator.create_migration_file
# end ### END chdir
end
#task default: [:db_prepare, :test]
task default: [:test]
task :console do
require 'active_snapshot'
require_relative 'test/dummy_app/app/models/post'
require 'irb'
binding.irb
end