Sha256: 8ef2b7dd0582d97fda19bc8dc29b17162d501691de21d2a824f6dd280102f527

Contents?: true

Size: 1.04 KB

Versions: 15

Compression:

Stored size: 1.04 KB

Contents

RSpec.shared_examples_for 'framework integration' do
  around do |example|
    Bundler.with_clean_env do
      Dir.chdir(TestApp.root) do
        Kernel.system("bundle install --gemfile=#{gemfile}") || fail('Bundle install failed!')
        ENV['BUNDLE_GEMFILE'] = gemfile
        example.run
      end
    end
  end

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

  specify 'it allows to exclude mutations' do
    cli = <<-CMD.split("\n").join(' ')
      #{base_cmd}
      TestApp::Literal#string
      TestApp::Literal#uncovered_string
        --ignore-subject TestApp::Literal#uncovered_string
    CMD
    expect(Kernel.system(cli)).to be(true)
  end

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

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

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
mutant-0.8.13 spec/shared/framework_integration_behavior.rb
mutant-0.8.12 spec/shared/framework_integration_behavior.rb
mutant-0.8.11 spec/shared/framework_integration_behavior.rb
mutant-0.8.10 spec/shared/framework_integration_behavior.rb
mutant-0.8.9 spec/shared/framework_integration_behavior.rb
mutant-0.8.8 spec/shared/framework_integration_behavior.rb
mutant-0.8.7 spec/shared/framework_integration_behavior.rb
mutant-0.8.6 spec/shared/framework_integration_behavior.rb
mutant-0.8.5 spec/shared/framework_integration_behavior.rb
mutant-0.8.4 spec/shared/framework_integration_behavior.rb
mutant-0.8.3 spec/shared/framework_integration_behavior.rb
mutant-0.8.2 spec/shared/framework_integration_behavior.rb
mutant-0.8.1 spec/shared/framework_integration_behavior.rb
mutant-0.8.0 spec/shared/framework_integration_behavior.rb
mutant-0.7.9 spec/shared/framework_integration_behavior.rb