Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.65 KB | None | 0 0
  1. require 'spec_helper'
  2. require "bunny"
  3.  
  4. describe "RabbitMQ" do
  5.   it 'should send and recieve a message' do
  6.     TestBunny.send("test", "hello")
  7.     message = TestBunny.subscribe("test")
  8.     expect(message).to_not eq(nil)
  9.   end
  10.  
  11.   it 'consumer should recieve the correct message' do
  12.     correct_message = "iamcorrect"
  13.     TestBunny.send("test", correct_message)
  14.     message = TestBunny.subscribe("test")
  15.     expect(message).to eq(correct_message)
  16.   end
  17.  
  18.   it 'should be able to create a new Bunny connection' do
  19.     pass = false
  20.     begin
  21.       TestBunny.connect
  22.       pass = true
  23.     rescue
  24.     end
  25.     expect(pass).to eq(true)
  26.   end
  27. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement