-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
67 lines (54 loc) · 1.84 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
require 'bundler/setup'
require 'padrino-core/cli/rake'
require 'English'
ENV['RACK_ENV'] ||= 'test'
RACK_ENV = ENV['RACK_ENV'] ||= ENV['RACK_ENV'] ||= 'test' unless defined?(RACK_ENV)
# PadrinoTasks.use(:database)
# PadrinoTasks.init
PadrinoTasks.use(:database)
PadrinoTasks.use(:sequel)
PadrinoTasks.init
task :version do
require './lib/version'
puts Version.current
exit 0
end
require 'cucumber/rake/task'
Cucumber::Rake::Task.new(:acceptance) do |task|
task.cucumber_opts = ['features', '--tags \'not @wip and not @local\'', '--format pretty', '--format html -o reports/cucumber.html']
end
if %w[development test].include?(RACK_ENV)
task :all do
['rake spec', 'rake cucumber'].each do |cmd|
puts "Starting to run #{cmd}..."
system("export DISPLAY=:99.0 && bundle exec #{cmd}")
raise "#{cmd} failed!" unless $CHILD_STATUS.exitstatus.zero?
end
end
task :build_server do
['rake spec_report', 'rake cucumber_report'].each do |cmd|
puts "Starting to run #{cmd}..."
system("export DISPLAY=:99.0 && bundle exec #{cmd}")
raise "#{cmd} failed!" unless $CHILD_STATUS.exitstatus.zero?
end
end
require 'cucumber/rake/task'
Cucumber::Rake::Task.new(:cucumber) do |task|
Rake::Task['db:migrate'].invoke
task.cucumber_opts = ['features', '--tags \'not @wip\'']
end
Cucumber::Rake::Task.new(:cucumber_report) do |task|
Rake::Task['db:migrate'].invoke
task.cucumber_opts = ['features', '--format html -o reports/cucumber.html']
end
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec) do |t|
Rake::Task['db:migrate'].invoke
t.pattern = './spec/**/*_spec.rb'
end
RSpec::Core::RakeTask.new(:spec_report) do |t|
t.pattern = './spec/**/*_spec.rb'
t.rspec_opts = %w[--format RspecJunitFormatter --out reports/spec/spec.xml]
end
task default: [:all]
end