mirror of
https://github.com/jimeh/amqp-failover.git
synced 2026-02-19 10:56:44 +00:00
updated load paths and structure of specs a bit
This commit is contained in:
@@ -1,19 +1,20 @@
|
|||||||
# encoding: utf-8
|
# encoding: utf-8
|
||||||
|
$LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__))
|
||||||
|
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
require 'amqp/server'
|
require 'amqp/server'
|
||||||
require 'spec_server'
|
require 'server_helper'
|
||||||
|
|
||||||
describe "Simple AMQP connection with FailoverClient" do
|
describe "Simple AMQP connection with FailoverClient" do
|
||||||
|
|
||||||
before(:all) do
|
before(:all) do
|
||||||
@log = SpecServer.log
|
@log = ServerHelper.log
|
||||||
|
AMQP.client = AMQP::FailoverClient
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should be connected" do
|
it "should be connected" do
|
||||||
AMQP.client = AMQP::FailoverClient
|
|
||||||
EM.run {
|
EM.run {
|
||||||
@sig = EM.start_server('localhost', 15672, SpecServer)
|
sig = EM.start_server('localhost', 15672, ServerHelper)
|
||||||
conn = AMQP.connect(:host => 'localhost', :port => 15672)
|
conn = AMQP.connect(:host => 'localhost', :port => 15672)
|
||||||
EM.add_timer(0.1) {
|
EM.add_timer(0.1) {
|
||||||
conn.should be_connected
|
conn.should be_connected
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# encoding: utf-8
|
# encoding: utf-8
|
||||||
|
|
||||||
module SpecServer
|
module ServerHelper
|
||||||
include AMQP::Server
|
include AMQP::Server
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
@@ -1,16 +1,18 @@
|
|||||||
# encoding: utf-8
|
# encoding: utf-8
|
||||||
|
|
||||||
# add project-relative load paths
|
# add project-relative load paths
|
||||||
$LOAD_PATH.unshift File.dirname(__FILE__)
|
$LOAD_PATH.unshift File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
|
||||||
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
|
$LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__))
|
||||||
|
|
||||||
# require stuff
|
# require stuff
|
||||||
require 'rubygems'
|
require 'rubygems'
|
||||||
|
|
||||||
begin
|
begin
|
||||||
require 'mq'
|
require 'mq'
|
||||||
rescue Object => e
|
rescue LoadError => e
|
||||||
require 'amqp'
|
require 'amqp'
|
||||||
end
|
end
|
||||||
require 'amqp/failover'
|
require 'amqp/failover'
|
||||||
|
|
||||||
require 'rspec'
|
require 'rspec'
|
||||||
require 'rspec/autorun'
|
require 'rspec/autorun'
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
# encoding: utf-8
|
# encoding: utf-8
|
||||||
|
$LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__))
|
||||||
|
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user