Sha256: 3189cdcb79479a46aa48ba2b1c2335e813e6e3dca0f61e3de02a0c489ef4e50e

Contents?: true

Size: 944 Bytes

Versions: 46

Compression:

Stored size: 944 Bytes

Contents

require 'spec_helper'

describe Pwwka::TestHandler::Message do
  let(:delivery_info) { double("delivery info") }
  let(:properties) { double("properties") }
  let(:payload) { { foo: "bar" }.to_json }

  subject(:message) { described_class.new(delivery_info,properties,payload) }

  describe "attributes" do
    specify { expect(message.delivery_info).to eq(delivery_info) }
    specify { expect(message.properties).to    eq(properties) }
    specify { expect(message.payload).to       eq(JSON.parse(payload)) }
  end

  describe "splatting" do
    it "extracts pieces during a splat" do
      extracted_delivery_info,extracted_payload,extracted_properties,extracted_raw_payload = message
      expect(extracted_delivery_info).to  eq(delivery_info)
      expect(extracted_properties).to     eq(properties)
      expect(extracted_payload).to        eq(JSON.parse(payload))
      expect(extracted_raw_payload).to    eq(payload)
    end
  end

end

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
pwwka-1.0.0 spec/unit/test_handler_message_spec.rb
pwwka-1.0.0.RC1 spec/unit/test_handler_message_spec.rb
pwwka-0.24.0 spec/unit/test_handler_message_spec.rb
pwwka-0.23.0 spec/unit/test_handler_message_spec.rb
pwwka-0.22.7 spec/unit/test_handler_message_spec.rb
pwwka-0.22.7.RC spec/unit/test_handler_message_spec.rb
pwwka-0.23.0.RC2 spec/unit/test_handler_message_spec.rb
pwwka-0.22.6 spec/unit/test_handler_message_spec.rb
pwwka-0.23.RC1 spec/unit/test_handler_message_spec.rb
pwwka-0.22.5 spec/unit/test_handler_message_spec.rb
pwwka-0.22.4 spec/unit/test_handler_message_spec.rb
pwwka-0.22.3 spec/unit/test_handler_message_spec.rb
pwwka-0.22.2 spec/unit/test_handler_message_spec.rb
pwwka-0.21.3 spec/unit/test_handler_message_spec.rb
pwwka-0.22.2.RC4 spec/unit/test_handler_message_spec.rb
pwwka-0.22.2.RC3 spec/unit/test_handler_message_spec.rb
pwwka-0.22.2.RC2 spec/unit/test_handler_message_spec.rb
pwwka-0.22.0.RC2 spec/unit/test_handler_message_spec.rb
pwwka-0.22.0.RC spec/unit/test_handler_message_spec.rb
pwwka-0.21.2 spec/unit/test_handler_message_spec.rb