Sha256: e45d4e68ad0ba1ece4367a13a690c2c2400bf2270925edbeec8b8e595e6155a7

Contents?: true

Size: 1.08 KB

Versions: 2

Compression:

Stored size: 1.08 KB

Contents

# encoding: utf-8

namespace :metrics do
  allowed_versions = %w(mri-1.9.3 mri-2.0.0 rbx-1.9.3)

  enabled = begin
    require 'mutant'
  rescue LoadError
    false
  end

  config    = Develry.project.mutant
  enabled &&= config.enabled? && allowed_versions.include?(Develry.rvm)

  zombify = %w(
    adamantium equalizer ice_nine infecto anima concord abstract_type
    descendants_tracker parser rspec unparser mutant
  ).include?(config.name)

  if enabled && !ENV['DEVTOOLS_SELF']
    desc 'Measure mutation coverage'
    task mutant: :coverage do
      namespace =
        if zombify
          Mutant::Zombifier.zombify
          Zombie::Mutant
        else
          Mutant
        end

      namespaces = Array(config.namespace).map { |n| "::#{n}*" }
      status     = namespace::CLI.run(['--include', 'lib', '--require', config.name, *namespaces, config.strategy])

      if status.nonzero?
        Develry.notify 'Mutant task is not successful'
      end
    end
  else
    desc 'Measure mutation coverage'
    task mutant: :coverage do
      $stderr.puts 'Mutant is disabled'
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
develry-0.0.3 tasks/metrics/mutant.rake
develry-0.0.2 tasks/metrics/mutant.rake