Rakefile in gitdocs-0.5.0 vs Rakefile in gitdocs-0.6.0
- old
+ new
@@ -1,24 +1,41 @@
require 'bundler/gem_tasks'
require 'rake/testtask'
require 'jslint/tasks'
+require 'haml_lint/rake_task'
+require 'rubocop/rake_task'
JSLint.config_path = '.jslint.yml'
+HamlLint::RakeTask.new
+
+RuboCop::RakeTask.new
+
namespace :test do
# Separate the unit and integration tests when running the entire suite.
Rake::TestTask.new(:unit) do |t|
t.libs.push('lib')
t.test_files = FileList[File.expand_path('../test/unit/**/*_test.rb', __FILE__)]
t.verbose = true
end
- Rake::TestTask.new(integration: :unit) do |t|
- t.libs.push('lib')
- t.test_files = FileList[File.expand_path('../test/integration/**/*_test.rb', __FILE__)]
- t.verbose = true
+ namespace :integration do
+ Rake::TestTask.new(cli: 'test:unit') do |t|
+ t.libs.push('lib')
+ t.test_files = FileList[File.expand_path('../test/integration/cli/**/*_test.rb', __FILE__)]
+ t.verbose = true
+ end
+
+ Rake::TestTask.new(web: :cli) do |t|
+ t.libs.push('lib')
+ t.test_files = FileList[File.expand_path('../test/integration/web/**/*_test.rb', __FILE__)]
+ t.verbose = true
+ end
end
+
+ desc 'Run all integration tests'
+ task integration: 'integration:web'
end
# Keep a default test task for manually running any test
Rake::TestTask.new do |t|
t.libs.push('lib')
@@ -42,6 +59,15 @@
'./tmp/web/config.db'
)
end
end
-task default: 'test:integration'
+desc 'Run the daemon in debugging mode'
+task :debug do
+ exec('bin/gitdocs start --foreground --verbose --port 9999')
+end
+
+if ENV['TRAVIS']
+ task default: 'test:integration:cli'
+else
+ task default: 'test:integration'
+end