Sha256: 83997660c403346c374e3185a0cf66629c5a0c237e2cc9d1e34469afdf8f85f2

Contents?: true

Size: 396 Bytes

Versions: 3

Compression:

Stored size: 396 Bytes

Contents

RSpec.describe MessageParser do
  subject(:router) { MessageRouter.new }

  let(:message_class) { spy(parse: double) }

  before do
    stub_const 'Aggro::MESSAGE_TYPES', '01' => message_class
  end

  describe '.parse' do
    it 'should parse messages via message parse function' do
      MessageParser.parse '01'
      expect(message_class).to have_received(:parse).with '01'
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
aggro-0.0.4 spec/lib/aggro/message_parser_spec.rb
aggro-0.0.3 spec/lib/aggro/message_parser_spec.rb
aggro-0.0.2 spec/lib/aggro/message_parser_spec.rb