-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
90 lines (77 loc) · 2.4 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# encoding: utf-8
require 'rubygems'
require 'bundler'
begin
Bundler.setup(:default, :development)
rescue Bundler::BundlerError => e
$stderr.puts e.message
$stderr.puts "Run `bundle install` to install missing gems"
exit e.status_code
end
require 'rake'
require 'jeweler'
Jeweler::Tasks.new do |gem|
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
gem.name = "trackable_tasks"
gem.homepage = "http://github.com/jeremiahishere/trackable_tasks"
gem.license = "MIT"
gem.summary = %Q{Adds tracking to rake tasks}
gem.description = %Q{Adds tracking to rake tasks including error capturing and logging.}
gem.email = "jeremiah@cloudspace.com"
gem.authors = ["Jeremiah Hemphill"]
# dependencies defined in Gemfile
end
Jeweler::RubygemsDotOrgTasks.new
require 'rspec/core'
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec) do |spec|
spec.pattern = FileList['spec/**/*_spec.rb']
end
RSpec::Core::RakeTask.new(:rcov) do |spec|
spec.pattern = 'spec/**/*_spec.rb'
spec.rcov = true
end
require 'cucumber/rake/task'
Cucumber::Rake::Task.new(:features)
task :default => :spec
require 'yard'
YARD::Rake::YardocTask.new
# hudson ci
require 'ci/reporter/rake/rspec'
namespace :hudson do
def report_path
"spec/reports/"
end
task :report_setup do
rm_rf report_path
mkdir_p report_path
end
# hudson cucumber rake task
Cucumber::Rake::Task.new(:cucumber, "Run cucumber with hudson output") do |t|
t.cucumber_opts = %{spec/dummy/features --format junit --out #{report_path}}
end
end
#general cucumber rake tasks
require 'cucumber/rake/task'
namespace :cucumber do
Cucumber::Rake::Task.new(:all, 'run features that should pass') do |t|
t.cucumber_opts = "spec/dummy/features --format progress"
end
Cucumber::Rake::Task.new(:no_js, 'run features that should pass') do |t|
t.cucumber_opts = "spec/dummy/features --format progress --tags ~@javascript"
end
task :setup_js_with_vnc4server do
puts "Cucumber test with vnc4server"
ENV['DISPLAY'] = ":99"
%x{vncserver :99 2>/dev/null >/dev/null &}
%x{DISPLAY=:99 firefox 2>/dev/null >/dev/null &}
end
task :kill_js do
puts "Killing vnc, xvfb, and ff processes"
%x{killall Xvnc4}
%x{killall Xvfb}
%x{killall firefox}
end
end
#task :cucumber => ['cucumber:setup_js_with_vnc4server', 'cucumber:all', 'cucumber:kill_js']
task :cucumber => ['cucumber:all']