Sha256: 5af9f25d35f16c6753b367d6fc15ab8191f2e80fb9575ede897cefcf4308a9ea

Contents?: true

Size: 890 Bytes

Versions: 1

Compression:

Stored size: 890 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Mutant, 'rspec integration' do

  around do |example|
    Dir.chdir(TestApp.root) do
      example.run
    end
  end

  let(:base_cmd) { 'bundle exec mutant -I lib --require test_app --rspec' }

  specify 'it allows to kill mutations' do
    Kernel.system("#{base_cmd} ::TestApp::Literal#string').should be(true)")
  end

  specify 'it allows to exclude mutations' do
    cli = "#{base_cmd} ::TestApp::Literal#string --ignore-subject ::TestApp::Literal#uncovered_string"
    Kernel.system(cli).should be(true)
  end

  specify 'fails to kill mutations when they are not covered' do
    cli = "#{base_cmd} ::TestApp::Literal#uncovered_string"
    Kernel.system(cli).should be(false)
  end

  specify 'fails when some mutations are not covered' do
    cli = "#{base_cmd} ::TestApp::Literal"
    Kernel.system(cli).should be(false)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mutant-0.3.0.rc2 spec/integration/mutant/rspec_spec.rb