updated load paths and structure of specs a bit

This commit is contained in:
2011-01-27 11:10:37 +00:00
parent 01241a1689
commit 425caf9fb5
4 changed files with 13 additions and 9 deletions

View File

@@ -1,19 +1,20 @@
# encoding: utf-8
$LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__))
require 'spec_helper'
require 'amqp/server'
require 'spec_server'
require 'server_helper'
describe "Simple AMQP connection with FailoverClient" do
before(:all) do
@log = SpecServer.log
@log = ServerHelper.log
AMQP.client = AMQP::FailoverClient
end
it "should be connected" do
AMQP.client = AMQP::FailoverClient
EM.run {
@sig = EM.start_server('localhost', 15672, SpecServer)
sig = EM.start_server('localhost', 15672, ServerHelper)
conn = AMQP.connect(:host => 'localhost', :port => 15672)
EM.add_timer(0.1) {
conn.should be_connected

View File

@@ -1,6 +1,6 @@
# encoding: utf-8
module SpecServer
module ServerHelper
include AMQP::Server
class << self

View File

@@ -1,16 +1,18 @@
# encoding: utf-8
# add project-relative load paths
$LOAD_PATH.unshift File.dirname(__FILE__)
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
$LOAD_PATH.unshift File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__))
# require stuff
require 'rubygems'
begin
require 'mq'
rescue Object => e
rescue LoadError => e
require 'amqp'
end
require 'amqp/failover'
require 'rspec'
require 'rspec/autorun'
require 'rspec/autorun'

View File

@@ -1,4 +1,5 @@
# encoding: utf-8
$LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__))
require 'spec_helper'