2018-09-12 14:21:24 +00:00
|
|
|
# frozen_string_literal: true
|
2018-09-12 13:15:43 +00:00
|
|
|
|
2016-03-06 21:19:32 +00:00
|
|
|
RSpec.describe Mutant::Mutator do
|
|
|
|
describe '.handle' do
|
|
|
|
subject do
|
|
|
|
Class.new(described_class) do
|
2016-05-05 23:36:46 -07:00
|
|
|
const_set(:REGISTRY, Mutant::Registry.new)
|
2016-03-06 21:19:32 +00:00
|
|
|
|
|
|
|
handle :send
|
|
|
|
|
|
|
|
def dispatch
|
|
|
|
emit(parent)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'should register mutator' do
|
2016-05-05 23:36:46 -07:00
|
|
|
expect(subject.mutate(s(:send), s(:parent))).to eql([s(:parent)].to_set)
|
2016-03-06 21:19:32 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|