Add specification of chain matcher .build

This commit is contained in:
Markus Schirp 2014-07-06 03:16:17 +00:00
parent d827dc4543
commit aa96b1d978

View file

@ -43,4 +43,18 @@ describe Mutant::Matcher::Chain do
it_should_behave_like 'an idempotent method'
end
describe '.build' do
subject { described_class.build(matchers) }
context 'when one matcher given' do
let(:matchers) { [double('Matcher A')] }
it { should be(matchers.first) }
end
context 'when matchers given' do
let(:matchers) { [double('Matcher A'), double('Matcher B')] }
it { should eql(described_class.new(matchers)) }
end
end
end