Sha256: f53ef5de63f596ad84bb9eea9084539c26afc1b4e6e4c782011aa77606cc1468
Contents?: true
Size: 1.04 KB
Versions: 31
Compression:
Stored size: 1.04 KB
Contents
# frozen_string_literal: true describe Deimos::SchemaBackends::Base do let(:backend) { described_class.new(schema: 'schema', namespace: 'namespace') } let(:payload) { { foo: 1 } } it 'should validate on encode' do expect(backend).to receive(:validate).with(payload, schema: 'schema') expect(backend).to receive(:encode_payload).with(payload, schema: 'schema', topic: 'topic') backend.encode(payload, topic: 'topic') end it 'should validate and encode a passed schema' do expect(backend).to receive(:validate).with(payload, schema: 'schema2') expect(backend).to receive(:encode_payload).with(payload, schema: 'schema2', topic: 'topic') backend.encode(payload, schema: 'schema2', topic: 'topic') end it 'should decode a schema' do expect(backend).to receive(:decode_payload).with(payload, schema: 'schema') backend.decode(payload) end it 'should decode a passed schema' do expect(backend).to receive(:decode_payload).with(payload, schema: 'schema2') backend.decode(payload, schema: 'schema2') end end
Version data entries
31 entries across 31 versions & 1 rubygems