Prepare rakefile for the next episode
This commit is contained in:
parent
bc885e47bf
commit
6250573af8
1 changed files with 23 additions and 5 deletions
28
Rakefile
28
Rakefile
|
@ -1,10 +1,28 @@
|
||||||
require "bundler/gem_tasks"
|
require "bundler/gem_tasks"
|
||||||
require "rake/testtask"
|
require "rake/testtask"
|
||||||
|
require 'rubocop/rake_task'
|
||||||
|
|
||||||
Rake::TestTask.new(:test) do |t|
|
# Add additional test suite definitions to the default test task here
|
||||||
t.libs << "test"
|
namespace :spec do
|
||||||
t.libs << "lib"
|
desc 'Runs RuboCop on specified directories'
|
||||||
t.test_files = FileList["test/**/*_test.rb"]
|
RuboCop::RakeTask.new(:rubocop) do |task|
|
||||||
|
# Dirs: app, lib, test
|
||||||
|
task.patterns = ['exe/**/*.rb', 'lib/**/*.rb', 'spec/**/*_spec.rb']
|
||||||
|
|
||||||
|
# Make it easier to disable cops.
|
||||||
|
task.options << "--display-cop-names"
|
||||||
|
|
||||||
|
# Abort on failures (fix your code first)
|
||||||
|
task.fail_on_error = true
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
task :default => :test
|
Rake::TestTask.new(:spec) do |t|
|
||||||
|
t.libs << "spec"
|
||||||
|
t.libs << "lib"
|
||||||
|
t.test_files = FileList['spec/**/*_spec.rb']
|
||||||
|
end
|
||||||
|
|
||||||
|
# Rake::Task[:spec].enhance ['spec:rubocop']
|
||||||
|
|
||||||
|
task :default => :spec
|
||||||
|
|
Loading…
Reference in a new issue