Re: [rspec-users] rspec and should have_many through

2011-09-13 Thread Justin Ko
On Tue, Sep 13, 2011 at 8:53 PM, slavix wrote: > Hi, > Anyone can help me with rspec shoulda validations please. > I can't get the syntax right for these validations. Please correct me > >it { should have_one :tradable, :through => :trade_order} >it { should belong_to :source, :polymor

[rspec-users] rspec and should have_many through

2011-09-13 Thread slavix
Hi, Anyone can help me with rspec shoulda validations please. I can't get the syntax right for these validations. Please correct me it { should have_one :tradable, :through => :trade_order} it { should belong_to :source, :polymorphic => true } it { should have_many :transfers, :as =

Re: [rspec-users] Assertions for asynchronous behaviour

2011-09-13 Thread Alex Chaffee
Sure. "wait_for" is a method Brian Takita and I originally wrote for use in Selenium tests, then IIRC it made it into the Selenium gem and now lots of libraries use it (or their own version -- I make no patent claim on polling :-)). The wait_for I remember allowed you to customize the failure messa

Re: [rspec-users] Assertions for asynchronous behaviour

2011-09-13 Thread Sidu Ponnappa
> the_object.should eventually_call(:foo).within(2).seconds TDDing multithreaded apps. Good times. Best, Sidu. http://blog.sidu.in On 13 September 2011 20:08, Justin Ko wrote: > > > On Tue, Sep 13, 2011 at 6:56 AM, Matt Wynne wrote: >> >> Hi all, >> In GOOS[1] they use an assertion called asser

Re: [rspec-users] Assertions for asynchronous behaviour

2011-09-13 Thread Justin Ko
On Tue, Sep 13, 2011 at 6:56 AM, Matt Wynne wrote: > Hi all, > > In GOOS[1] they use an assertion called assertEventually which samples the > system for a success state until a certain timeout has elapsed. This allows > you to synchronise the tests with asynchronous code. > > Do we have an equiva

[rspec-users] Assertions for asynchronous behaviour

2011-09-13 Thread Matt Wynne
Hi all, In GOOS[1] they use an assertion called assertEventually which samples the system for a success state until a certain timeout has elapsed. This allows you to synchronise the tests with asynchronous code. Do we have an equivalent of that in the Ruby / RSpec world already? I know capybar

Re: [rspec-users] generate user-readable tests from Rspec tests?

2011-09-13 Thread wolf volpi
Now I understand better. Goggling "rspec formatter" shows that there are formatters for progress, documentation, and html. This will make more sense after I learn Rspec. Thank you David and Sidu. -- Posted via http://www.ruby-forum.com/. ___ rspec-