-
Notifications
You must be signed in to change notification settings - Fork 36
/
Rakefile
56 lines (43 loc) · 1.15 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
49
50
51
52
53
54
55
56
require "bundler/gem_tasks"
require "rspec/core/rake_task"
require "open-uri"
def yellow(str)
"\e[33m#{str}\e[m"
end
ENV['VAGRANT_CWD'] = File.expand_path('spec/integration/vm')
desc 'Run unit and integration tests'
task :spec => ['spec:unit', 'spec:integration']
namespace :spec do
RSpec::Core::RakeTask.new("unit") do |task|
task.pattern = "./spec/unit{,/*/**}/*_spec.rb"
end
RSpec::Core::RakeTask.new("integration") do |task|
task.pattern = "./spec/integration{,/*/**}/*_spec.rb"
end
namespace :integration do
integration_dir = 'spec/integration'
desc 'Clean'
task :clean => ['vagrant:destroy'] do
end
desc 'Prepare'
task :prepare => ['vagrant:up'] do
end
namespace :vagrant do
task :up do
puts yellow('Starting VM...')
system 'vagrant', 'up'
end
task :destroy do
puts yellow('Destroying VM...')
system 'vagrant', 'destroy', '-f'
end
task :provision do
puts yellow('Provisioning VM...')
system 'vagrant', 'provision'
end
task :ssh, :name do |t, args|
system 'vagrant', 'ssh', args[:name]
end
end
end
end