Skip to content

Commit

Permalink
Kill RuleConfig default options mutations
Browse files Browse the repository at this point in the history
  • Loading branch information
John Backus committed Sep 29, 2015
1 parent 96c330e commit 6b03fff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion config/mutant.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: yardstick
namespace: Yardstick
expect_coverage: 2378/2384
expect_coverage: 2381/2384
ignore_subjects:
# sometimes creates a neutral failure
- Yardstick::Rake::Measurement#define
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,37 @@
require 'spec_helper'

describe Yardstick::RuleConfig, '#enabled_for_path?' do
subject { described_class.new(options).enabled_for_path?(path) }

let(:options) { {} }
subject { instance.enabled_for_path?(path) }

%w[Foo::Bar#baz Foo::Bar.baz].each do |method|
let(:path) { method }

context 'when no restrictions' do
let(:instance) { described_class.new }

it { should be(true) }
end

context 'when disabled' do
before { options[:enabled] = false }
let(:instance) { described_class.new(enabled: false) }

it { should be(false) }
end

context 'when excluded by exact path' do
before { options[:exclude] = [path] }
let(:instance) { described_class.new(exclude: [path]) }

it { should be(false) }
end

context 'when excluded by class or module' do
before { options[:exclude] = ['Foo::Bar'] }
let(:instance) { described_class.new(exclude: ['Foo::Bar']) }

it { should be(false) }
end

context 'when excluded by superclass or subclass' do
before { options[:exclude] = ['Foo', 'Foo::Bar::Sub'] }
let(:instance) { described_class.new(exclude: ['Foo', 'Foo::Bar::Sub']) }

it { should be(true) }
end
Expand Down

0 comments on commit 6b03fff

Please sign in to comment.