-
Notifications
You must be signed in to change notification settings - Fork 26
/
Rakefile
50 lines (38 loc) · 988 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
40
41
42
43
44
45
46
47
48
49
50
# Copyright (c) 2009-2012 VMware, Inc.
$:.unshift(File.expand_path("../../rake", __FILE__))
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __FILE__)
require "rubygems"
require "bundler"
Bundler.setup(:default, :test)
require "rake"
begin
require "rspec/core/rake_task"
rescue LoadError
end
require "bundler_task"
require "ci_task"
gem_helper = Bundler::GemHelper.new(Dir.pwd)
desc "Build CPI gem into the pkg directory"
task "build" do
gem_helper.build_gem
end
desc "Build and install CPI into system gems"
task "install" do
Rake::Task["bundler:install"].invoke
gem_helper.install_gem
end
BundlerTask.new
if defined?(RSpec)
namespace :spec do
desc "Run Unit Tests"
rspec_task = RSpec::Core::RakeTask.new(:unit) do |t|
t.pattern = "spec/unit/**/*_spec.rb"
t.rspec_opts = %w(--format progress --colour)
end
CiTask.new do |task|
task.rspec_task = rspec_task
end
end
desc "Run tests"
task :spec => %w(spec:unit)
end