2016-03-06 16:19:32 -05:00
|
|
|
RSpec.describe Mutant::Mutator do
|
|
|
|
describe '.handle' do
|
|
|
|
let(:object) { described_class }
|
|
|
|
|
|
|
|
subject do
|
|
|
|
Class.new(described_class) do
|
2016-05-06 02:36:46 -04:00
|
|
|
const_set(:REGISTRY, Mutant::Registry.new)
|
2016-03-06 16:19:32 -05:00
|
|
|
|
|
|
|
handle :send
|
|
|
|
|
|
|
|
def dispatch
|
|
|
|
emit(parent)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'should register mutator' do
|
2016-05-06 02:36:46 -04:00
|
|
|
expect(subject.mutate(s(:send), s(:parent))).to eql([s(:parent)].to_set)
|
2016-03-06 16:19:32 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|