Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 65 lines (49 sloc) 1.17 kb
15107cc @alloy Add Rakefile with test task.
alloy authored
1
4287f61 @alloy Return sanity to the test suite and ignore the normal statistics cache.
alloy authored
2 task :default => :spec
98a4c88 @fabiopelosin [Travis] Attempt to fix dependencies issues.
fabiopelosin authored
3
2e12d8d @fabiopelosin [WIP] Modernize
fabiopelosin authored
4 #--------------------------------------#
98a4c88 @fabiopelosin [Travis] Attempt to fix dependencies issues.
fabiopelosin authored
5
4db1e62 @fabiopelosin [Rubocop] Autocorrect
fabiopelosin authored
6 desc 'Initializes your working copy to run the specs'
343dae2 @alloy Add rake bootstrap task.
alloy authored
7 task :bootstrap do
4db1e62 @fabiopelosin [Rubocop] Autocorrect
fabiopelosin authored
8 title 'Environment bootstrap'
343dae2 @alloy Add rake bootstrap task.
alloy authored
9
4db1e62 @fabiopelosin [Rubocop] Autocorrect
fabiopelosin authored
10 puts 'Updating submodules'
11 execute_command 'git submodule update --init --recursive'
343dae2 @alloy Add rake bootstrap task.
alloy authored
12
4db1e62 @fabiopelosin [Rubocop] Autocorrect
fabiopelosin authored
13 puts 'Installing gems'
14 execute_command 'bundle install'
343dae2 @alloy Add rake bootstrap task.
alloy authored
15 end
16
17 #--------------------------------------#
18
4db1e62 @fabiopelosin [Rubocop] Autocorrect
fabiopelosin authored
19 desc 'Runs the site locally'
a3807f0 @fabiopelosin [Rakefile] Add run task
fabiopelosin authored
20 task :run do
4db1e62 @fabiopelosin [Rubocop] Autocorrect
fabiopelosin authored
21 title 'Running locally'
22 sh 'open http://0.0.0.0:5000'
23 sh 'foreman start'
a3807f0 @fabiopelosin [Rakefile] Add run task
fabiopelosin authored
24 end
25
26 #--------------------------------------#
27
2e12d8d @fabiopelosin [WIP] Modernize
fabiopelosin authored
28 namespace :spec do
4db1e62 @fabiopelosin [Rubocop] Autocorrect
fabiopelosin authored
29 desc 'Run all the specs'
2e12d8d @fabiopelosin [WIP] Modernize
fabiopelosin authored
30 task :all do
31 sh "bundle exec bacon #{specs('**')}"
98a4c88 @fabiopelosin [Travis] Attempt to fix dependencies issues.
fabiopelosin authored
32 end
33
4db1e62 @fabiopelosin [Rubocop] Autocorrect
fabiopelosin authored
34 desc 'Run the unit specs'
2e12d8d @fabiopelosin [WIP] Modernize
fabiopelosin authored
35 task :unit do
36 sh "bundle exec bacon #{specs('unit/**')}"
98a4c88 @fabiopelosin [Travis] Attempt to fix dependencies issues.
fabiopelosin authored
37 end
97e0352 @alloy Make it work on Ruby 1.8.7
alloy authored
38 end
39
4287f61 @alloy Return sanity to the test suite and ignore the normal statistics cache.
alloy authored
40 task :spec => 'spec:all'
41
2e12d8d @fabiopelosin [WIP] Modernize
fabiopelosin authored
42 def specs(dir)
43 FileList["spec/#{dir}/*_spec.rb"].shuffle.join(' ')
bdb3a2d @fabiopelosin [Tests] Small tweak to rakefile
fabiopelosin authored
44 end
9f02206 @fabiopelosin [tests] Added possibility to run subtests
fabiopelosin authored
45
2e12d8d @fabiopelosin [WIP] Modernize
fabiopelosin authored
46 #--------------------------------------#
15107cc @alloy Add Rakefile with test task.
alloy authored
47
a3807f0 @fabiopelosin [Rakefile] Add run task
fabiopelosin authored
48 def execute_command(command)
49 if ENV['VERBOSE']
50 sh(command)
51 else
52 output = `#{command} 2>&1`
77460a0 @fabiopelosin [Rakefile] Fix on Travis
fabiopelosin authored
53 raise output unless $?.success?
a3807f0 @fabiopelosin [Rakefile] Add run task
fabiopelosin authored
54 end
55 end
56
57 def title(title)
58 cyan_title = "\033[0;36m#{title}\033[0m"
59 puts
4db1e62 @fabiopelosin [Rubocop] Autocorrect
fabiopelosin authored
60 puts '-' * 80
a3807f0 @fabiopelosin [Rakefile] Add run task
fabiopelosin authored
61 puts cyan_title
4db1e62 @fabiopelosin [Rubocop] Autocorrect
fabiopelosin authored
62 puts '-' * 80
a3807f0 @fabiopelosin [Rakefile] Add run task
fabiopelosin authored
63 puts
64 end
Something went wrong with that request. Please try again.