-
Notifications
You must be signed in to change notification settings - Fork 13
/
Rakefile
49 lines (40 loc) · 1.12 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
require 'spec/rake/spectask'
require "rcov/rcovtask"
task :default => "test"
desc "Executa todas as specs."
task :test => "test:spec"
desc "Executa os relatórios de cobertura."
task :coverage => "test:coverage"
desc "Limpa o lixo."
task :clean do
system "rm -rf reports"
system "rm -rf correios-api-*.gem"
end
desc "Inicia a API de webservices REST."
task :api do
system "cd lib; ruby correios_rest_api.rb"
end
namespace :gem do
desc "Faz o build do gem."
task :build do
system "gem build correios-api.gemspec"
end
desc "Instala todas as gems que a correios-api depende."
task :install_dependencies do
system "gem install hpricot sinatra"
end
end
namespace :test do
desc "Executa todas as specs."
Spec::Rake::SpecTask.new(:spec) do |spec|
spec.spec_files = FileList["spec/**/*_spec.rb"]
end
desc "Gera relatórios de cobertura de testes e specs."
Spec::Rake::SpecTask.new(:coverage) do |rcov|
rcov.rcov = true
rcov.rcov_dir = "reports/coverage"
rcov.spec_opts = ["--format", "html:reports/specs/index.html", "--diff"]
rcov.fail_on_error = false
rcov.verbose = true
end
end