-
Notifications
You must be signed in to change notification settings - Fork 5
/
Rakefile
48 lines (39 loc) · 1.13 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env rake
require 'rubygems'
require 'rspec/core/rake_task'
desc "Run specs"
task :default => :spec
RSpec::Core::RakeTask.new(:spec) do |t|
t.pattern = ['./spec/**/*_spec.rb', './spec/**/factories/*.rb']
end
desc 'Generates a full dummy app for testing'
task :dummy => [
:removing_app,
:generating_app,
:support_files,
:setup,
:cleanning_project
]
test = File.expand_path('../spec/dummy', __FILE__)
config = File.expand_path('../spec/support/config', __FILE__)
task :removing_app do
sh "rm -rf #{test}"
end
task :generating_app do
sh "rails new #{test} -q -f -G -S -J -T --skip-bundle --skip-gemfile"
end
task :support_files do
sh "cp #{config}/* #{test}/config"
end
task :setup do
sh "cd #{test};RAILS_ENV=test rails g model user name:string email:string"
sh "cd #{test};echo user | RAILS_ENV=test rails g sigma;"
end
task :cleanning_project do
sh "rm -rf #{test}/spec"
sh "rm -rf #{test}/doc"
sh "rm -rf #{test}/README.rdoc"
sh "rm -rf #{test}/tmp"
sh "rm -rf #{test}/vendor"
sh "rm -rf #{test}/public"
end