OSC / osc-machete

High level interface to submitting and checking the status of batch jobs (currently OSC specific)
MIT License
1 stars 0 forks source link

Add TorqueHelper factory method to fix tests #49

Open ericfranz opened 9 years ago

ericfranz commented 9 years ago

There is a FIXME comment on this test: https://github.com/AweSim-OSC/osc-machete/blob/280f5bc314652a18e3055e72066a3c240ef4f6e3/test/test_statusable.rb#L69-L96

In the test setup we can do something like:

th = TorqueHelper.default
th.expects(:status).with("1234").returns("R")
th.expects(:status).with("4567").returns("C")

etc. (however you do this in mocha)

then

TorqueHelper.expects(:default).returns(th)

So you can use actual Job objects in your tests instead of OpenStruct.

ericfranz commented 9 years ago

You would use a custom torque helper with stubbed methods.