can't add a new key into hash during iteration
Created by: Papipo
describe EventSourcing::CommandHandler do
let(:event) { double("Event") }
let(:store) { double("EventStore") }
let(:command) { double("Command", execute: event)}
subject { EventSourcing::CommandHandler.new(store) }
it "stores events returned by commands" do
expect(store).to receive(:append).with(event)
subject.execute(command)
end
end
I have the above scenario, and I get this error when running it:
can't add a new key into hash during iteration
the offending line is the one with the with() call. If I remove it or if the argument is for example a String instead of a double, it works fine.