Skip to content

Instantly share code, notes, and snippets.

@qubitrenegade
Last active February 13, 2018 05:37
Show Gist options
  • Save qubitrenegade/39f1b2e6e2f24181e307841ba180ef41 to your computer and use it in GitHub Desktop.
Save qubitrenegade/39f1b2e6e2f24181e307841ba180ef41 to your computer and use it in GitHub Desktop.
# frozen_string_literal: true
# The MIT License (MIT)
#
# Copyright:: 2017, QubitRenegade
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
# include and initialize rubocop
require 'rubocop/rake_task'
RuboCop::RakeTask.new do |rubocop|
rubocop.options = ['--display-cop-names']
end
# include an intialize foodcritic
require 'foodcritic'
FoodCritic::Rake::LintTask.new do |foodcritic|
foodcritic.options[:fail_tags] = %w(any)
end
# Include and intialize RSpec
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new do |rspec|
rspec.rspec_opts = "--color --format documentation"
end
# Include and intialize Test Kitchen
require 'kitchen/rake_tasks'
Kitchen::RakeTasks.new
# Set our default task as the "all" task
task default: :all
# Create our "all" task to run our "test" task and kitchen:all
desc 'Run all tests'
task all: [:test, 'kitchen:all']
# Create "test" task that runs rubocop and foodcritic style checks and RSpec tests
desc 'Run all style checks and unit tests'
task test: [:style, :spec]
# Create a "style" test that runs rubocop and foodcritic tests.
desc 'Run Rubocop and Foodcritic style checks'
task style: [:rubocop, :foodcritic]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment