[Backgroundrb-devel] bdrb w/ functional tests?

Ian Smith-Heisters heisters at greenriver.org
Mon Feb 4 20:27:02 EST 2008


I was running into errors trying to run functional tests on
controllers that use MiddleMan, since my test environment doesn't have
a bdrb server running.

BackgrounDRb::BdrbConnError: Not able to connect
    vendor/plugins/backgroundrb/lib/backgroundrb.rb:39:in `ask_work'

The relevant lines of test/test_helper.rb looks like this:

  require File.expand_path(File.dirname(__FILE__) + "/bdrb_test_helper")
  require *Dir.glob(RAILS_ROOT + '/lib/workers/*.rb')

(I had to remove the "require 'test_helper'" line in bdrb_test_helper
for that to work).

Since I only use #ask_work, I stubbed this out in the bdrb_test_helper:

module BackgrounDRb
  # Added WorkerProxy stub so that functional tests will run
  class WorkerProxy
    def ask_work(arg)
      return true

which seems to work for the moment. It'd be nice if this stuff Just
Worked, though.


More information about the Backgroundrb-devel mailing list