forked from otto-de-legacy/marathon-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
39 lines (30 loc) · 936 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
34
35
36
37
38
39
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), 'lib'))
require 'rake'
require 'json'
require 'marathon'
require 'rspec/core/rake_task'
require 'vcr'
require 'cane/rake_task'
task :default => [:spec, :quality]
RSpec::Core::RakeTask.new do |t|
t.pattern = 'spec/**/*_spec.rb'
end
Cane::RakeTask.new(:quality) do |cane|
cane.canefile = '.cane'
end
dir = File.expand_path(File.dirname(__FILE__))
namespace :vcr do
desc 'Remove VCR files'
task :clean do
FileUtils.remove_dir("#{dir}/fixtures/vcr", true)
end
desc 'Preapre Marathon by deploying some tasks'
task :prepare do
json = JSON.parse(File.read("#{dir}/fixtures/marathon_docker_sample.json"))
Marathon::App.new(json).start!
json = JSON.parse(File.read("#{dir}/fixtures/marathon_docker_sample_2.json"))
Marathon::App.new(json).start!
end
desc 'Run spec tests and record VCR cassettes'
task :record => [:clean, :prepare, :spec]
end