Sha256: e3eac6ad9b72e6474005ed093fa6d31a7a3ceec829f76befea5929c8a8937790

Contents?: true

Size: 1.37 KB

Versions: 1

Compression:

Stored size: 1.37 KB

Contents

# -*- encoding : utf-8 -*-
require 'bundler/gem_tasks'
require 'rspec/core/rake_task'
require 'yard/rake/yardoc_task'
require 'inch/rake'
require 'reek/rake/task'

desc 'Run all specs'
task spec: ['spec:unit', 'spec:acceptance']

namespace :spec do
  desc 'Run unit specs'
  RSpec::Core::RakeTask.new(:unit) do |task|
    task.pattern = 'spec/unit/**/*_spec.rb'
  end

  desc 'Run acceptance specs – requires running instance of ArangoDB'
  RSpec::Core::RakeTask.new(:acceptance) do |task|
    task.pattern = 'spec/acceptance/**/*_spec.rb'
  end
end

YARD::Rake::YardocTask.new(:doc)

namespace :metrics do
  Inch::Rake::Suggest.new do |t|
    t.args << '--pedantic'
  end

  Reek::Rake::Task.new do |t|
    t.fail_on_error = true
    t.config_files = 'config/reek.yml'
  end

  desc 'Run mutant to check for mutation coverage'
  task :mutant do
    require 'mutant'
    require 'mutant-rspec'

    namespaces = YAML.load_file('config/mutant.yml').map { |n| "::#{n}*" }
    arguments  = %w(--include lib --require ashikawa-core --use rspec).concat(namespaces)
    status = Mutant::CLI.run(arguments)
    exit 'Mutant task is not successful' if status.nonzero?
  end
end

desc 'Start a REPL with guacamole loaded (not the Rails part)'
task :console do
  require 'bundler/setup'

  require 'pry'
  require 'ashikawa-core'
  ARGV.clear
  Pry.start
end

task default: :spec
task ci: ['spec', 'metrics:reek']

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ashikawa-core-0.11.0 Rakefile