diff --git a/Rakefile b/Rakefile index 802bdcc..358da59 100644 --- a/Rakefile +++ b/Rakefile @@ -1,4 +1,3 @@ # frozen_string_literal: true Dir.glob('lib/tasks/*.rake').each { |r| import r } -task default: %w(db:migrate rates:load test rubocop) diff --git a/lib/tasks/rubocop.rake b/lib/tasks/rubocop.rake deleted file mode 100644 index 686fb05..0000000 --- a/lib/tasks/rubocop.rake +++ /dev/null @@ -1,5 +0,0 @@ -# frozen_string_literal: true - -require 'rubocop/rake_task' - -RuboCop::RakeTask.new diff --git a/lib/tasks/test.rake b/lib/tasks/test.rake index c2ace8f..f8e092e 100644 --- a/lib/tasks/test.rake +++ b/lib/tasks/test.rake @@ -1,9 +1,16 @@ # frozen_string_literal: true +return unless ENV['RACK_ENV'] == 'test' + require 'rake/testtask' +require 'rubocop/rake_task' Rake::TestTask.new(test: :environment) do |t| t.libs.push('lib') t.test_files = FileList['spec/*_spec.rb'] t.ruby_opts += ['-W0'] end + +RuboCop::RakeTask.new + +task default: %w(db:migrate rates:load test rubocop)