Sha256: 3034bfa2c5d2f6ffa58791d698cc9990b220af9e2e3073c638c0c786a3d72b0d

Contents?: true

Size: 839 Bytes

Versions: 31

Compression:

Stored size: 839 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

describe RubyRabbitmqJanus::Janus::Responses::Standard, type: :responses,
                                                        name: :standard do
  let(:response) { described_class.new(message) }

  describe '#sender' do
    context 'with no data' do
      let(:message) { {} }

      it { expect { response.sender }.to raise_error(RubyRabbitmqJanus::Errors::Janus::Responses::Standard::Data) }
    end

    context 'with no id' do
      let(:message) { { 'data' => {} } }

      it { expect { response.sender }.to raise_error(RubyRabbitmqJanus::Errors::Janus::Responses::Standard::Sender) }
    end

    context 'with a sender' do
      let(:message) { { 'data' => { 'id' => (rand * 10_000).to_i } } }

      it { expect(response.sender).to be_kind_of(Integer) }
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
ruby_rabbitmq_janus-3.0.0 spec/ruby_rabbitmq_janus/janus/responses/standard_sender_spec.rb
ruby_rabbitmq_janus-3.0.0.pre.387 spec/ruby_rabbitmq_janus/janus/responses/standard_sender_spec.rb
ruby_rabbitmq_janus-3.0.0.pre.385 spec/ruby_rabbitmq_janus/janus/responses/standard_sender_spec.rb
ruby_rabbitmq_janus-3.0.0.pre.384 spec/ruby_rabbitmq_janus/janus/responses/standard_sender_spec.rb
ruby_rabbitmq_janus-3.0.0.pre.382 spec/ruby_rabbitmq_janus/janus/responses/standard_sender_spec.rb
ruby_rabbitmq_janus-3.0.0.pre.366 spec/ruby_rabbitmq_janus/janus/responses/standard_sender_spec.rb
ruby_rabbitmq_janus-3.0.0.pre.364 spec/ruby_rabbitmq_janus/janus/responses/standard_sender_spec.rb
ruby_rabbitmq_janus-3.0.0.pre.358 spec/ruby_rabbitmq_janus/janus/responses/standard_sender_spec.rb
ruby_rabbitmq_janus-3.0.0.pre.354 spec/ruby_rabbitmq_janus/janus/responses/standard_sender_spec.rb
ruby_rabbitmq_janus-3.0.0.pre.352 spec/ruby_rabbitmq_janus/janus/responses/standard_sender_spec.rb
ruby_rabbitmq_janus-3.0.0.pre.351 spec/ruby_rabbitmq_janus/janus/responses/standard_sender_spec.rb