Okay, Here is a very very simple example:
For a worker foo_worker, create foo
require File.join(File.dirname(__FILE__),"..","bdrb_test_helper")
require "foo_worker"
context "For Foo worker" do
setup do
@foo_worker = FooWorker.new
end
specify "should add two numbers" do
a = @foo_worker.add_number(:num1 => 10,:num2 => 20)
a.should == 30
end
end
And run it with:
specrb test/unit/foo_worker_test.rb
On Mon, Aug 18, 2008 at 8:17 AM, kevin olsen <[EMAIL PROTECTED]> wrote:
> hemant: could you explain?
>
> I too would like to see an example of someone testing a worker, whether it
> is with rspec or test/[unit,spec]
>
> cheers
>
> On Aug 17, 2008, at 10:45 AM, hemant wrote:
>
>> On Sat, Aug 16, 2008 at 3:12 PM, Marcos Piccinini <[EMAIL PROTECTED]>
>> wrote:
>>>
>>> Morning gentleman,
>>>
>>> I would like to ask if someone can post a example ( or maybe a rspec
>>> bdrb_test_helper ) for a rspec testing a backgroundrb worker.
>>>
>>> Im kinda confused.. heh
>>>
>>
>> That spec_helper is for test/spec, but the basic idea is to not use
>> actual MetaWorker class while writing test cases for your workers.
>> _______________________________________________
>> Backgroundrb-devel mailing list
>> [email protected]
>> http://rubyforge.org/mailman/listinfo/backgroundrb-devel
>
> _______________________________________________
> Backgroundrb-devel mailing list
> [email protected]
> http://rubyforge.org/mailman/listinfo/backgroundrb-devel
>
--
Let them talk of their oriental summer climes of everlasting
conservatories; give me the privilege of making my own summer with my
own coals.
http://gnufied.org
_______________________________________________
Backgroundrb-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/backgroundrb-devel