thoughtbot--shoulda-matchers/spec/unit/shoulda/matchers/doublespeak/double_implementation_regis...

22 lines
657 B
Ruby

require 'doublespeak_spec_helper'
module Shoulda::Matchers::Doublespeak
describe DoubleImplementationRegistry do
describe '.find' do
it 'returns an instance of StubImplementation if given :stub' do
expect(described_class.find(:stub)).to be_a(StubImplementation)
end
it 'returns ProxyImplementation if given :proxy' do
expect(described_class.find(:proxy)).to be_a(ProxyImplementation)
end
it 'raises an ArgumentError if not given a registered implementation' do
expect {
expect(described_class.find(:something_else))
}.to raise_error(ArgumentError)
end
end
end
end