Sha256: 6a5c9a8bc436663f8b17015f7de331d496ee2e75a4b5824a96b3226e14d894ee
Contents?: true
Size: 725 Bytes
Versions: 22
Compression:
Stored size: 725 Bytes
Contents
require 'spec_helper' describe Fluffle::Handlers::Dispatcher do before do @handler = Fluffle::Handlers::Dispatcher.new @handler.handle('double_it') { |arg| arg * 2 } end it 'calls the method with the params on the delegated object' do result = @handler.call id: 'abc123', method: 'double_it', params: [2], meta: {} expect(result).to eq(4) end it 'raises error if method not configured' do expect { @handler.call id: 'def456', method: 'doesnt_exist', params: ['whatever'], meta: {} }.to raise_error(NoMethodError, /doesnt_exist/) end end
Version data entries
22 entries across 22 versions & 1 rubygems