[Backgroundrb-devel] BDRB and Rspec

Nicholas Wieland nicholas.wieland at gmail.com
Wed Mar 18 18:32:09 EDT 2009


Hi guys, I would like to test my worker with RSpec, but till now I'm
not able to understand how to require it and the few references I've
found around doesn't seem to work.

My Spec is more or less like that:


spec/models/contest_worker_spec.rb

describe ContestWorker do

 setup do
   @contest_worker = ContestWorker.new
 end

 it 'should put the contest in incoming state' do
   contest = Contest.create( :title => 'foobar', :start_date =>
2.weeks.from_now, :end_date => 2.months.from_now )
   @contest_worker.state_update
   contest.should be_incoming
 end

end


My worker basically loops over an AR resultset and updates some data,
nothing big.
The point is, I guess, require bdrb and the worker itself
(uninitialized constant ContestWorker), but I don't know how to do it.
Should I require something inside the spec_helper ?

 ngw


More information about the Backgroundrb-devel mailing list