Sha256: 6f9fc06182321919626f9bc83934f0eb6812d734c905a352b3494de321da72c2

Contents?: true

Size: 799 Bytes

Versions: 6

Compression:

Stored size: 799 Bytes

Contents

require 'spec_helper'
require 'rflow/components/raw'

class RFlow
  class Message
    class Data
      describe 'Raw Avro Schema' do
        let(:schema) { Configuration.available_data_types['RFlow::Message::Data::Raw']['avro'] }

        it "should load the schema" do
          expect(schema).not_to be_nil
        end

        it "should encode and decode an object" do
          raw = {'raw' => Array.new(256) { rand(256) }.pack('c*')}

          expect { encode_avro(schema, raw) }.to_not raise_error
          encoded = encode_avro(schema, raw)

          expect { decode_avro(schema, encoded) }.to_not raise_error
          decoded = decode_avro(schema, encoded)

          expect(decoded).to eq(raw)
          expect(decoded['raw']).to eq(raw['raw'])
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rflow-1.0.1 spec/rflow/message/data/raw_spec.rb
rflow-1.0.0 spec/rflow/message/data/raw_spec.rb
rflow-1.0.0a6 spec/rflow/message/data/raw_spec.rb
rflow-1.0.0a5 spec/rflow/message/data/raw_spec.rb
rflow-1.0.0a4 spec/rflow/message/data/raw_spec.rb
rflow-1.0.0a3 spec/rflow/message/data/raw_spec.rb