Re: [rspec-users] another noob question about stubs

2008-05-05 Thread Hans de Graaff
On Wed, 2008-04-30 at 11:26 -0500, Patrick Aljord wrote: > My spec looks like this: > it "should login with openid and redirect" do > openid_url = "patcito.myopenid.com" > controller.stub!(:using_open_id?).and_return(true) > > controller.stub!(:authenticate_with_open_id).and_yield(r

[rspec-users] "Plugin not found" after RSpec install

2008-05-05 Thread Eeby
I tried to install the RSpec Rails plugin as described here: http://rspec.info/documentation/rails/install.html After I run this... ruby script/plugin install http://rspec.rubyforge.org/svn/tags/CURRENT/rspec At the very end after a lot of output I get this error: Plugin not found: ["http://

[rspec-users] "Plugin not found" after RSpec install

2008-05-05 Thread Eeby
I tried to install the RSpec Rails plugin as described here: http://rspec.info/documentation/rails/install.html After I run this... ruby script/plugin install http://rspec.rubyforge.org/svn/tags/CURRENT/rspec At the very end after a lot of output I get this error: Plugin not found: ["http://rs

Re: [rspec-users] specifying output of render call

2008-05-05 Thread Pat Maddox
Hey Matt, One problem with rjs is that it's very difficult to test. You can't execute it, and executing code is necessary for specification by example. In this case, I would probably not unit test that code, based on the combination of it being simple code but difficult to test. I would probabl

[rspec-users] specifying output of render call

2008-05-05 Thread Matt McNeil
Hello again, First of all, thanks much for everyone's input on my question last week about spec'ing an invocation of super. Here's another question that seems resistant to my Google searching: With this helper method (defined in a module and included in Rails controllers): def render_rjs_red

Re: [rspec-users] Date comparisons

2008-05-05 Thread s.ross
On May 4, 2008, at 11:07 PM, Aslak Hellesøy wrote: If your code uses Date#now, always make sure you stub it in your specs. Always. Yes, but the OP's question was why do two "same" date objects compare as different. This is a typical problem with floating-point and anything that counts tim

Re: [rspec-users] Problems with redirect_to

2008-05-05 Thread Cyril Mougel
David Chelimsky wrote: > On Fri, Feb 22, 2008 at 9:20 AM, Maur�cio Linhares > <[EMAIL PROTECTED]> wrote: >> "/pages/test" and sent it two the recognize_path method, but this path >> ActionController::Routing::Routes.recognize_path path, :method => >> :get >> end >> >> As you ca

Re: [rspec-users] Date comparisons

2008-05-05 Thread Dan North
The (pretty much universal) problem with dates and times is that people use "date" and "time" to mean different things. There's a java library called joda that provides a really clean vocabulary around this. An *instant* is a point in time. You shouldn't be able to ask for two instants and get the

Re: [rspec-users] Date comparisons

2008-05-05 Thread Jarkko Laine
On 5.5.2008, at 11.02, Pat Maddox wrote: Yes, that was my first idea as well. The Time class is a little fucked up in that < a, b = Time.now, Time.now < a == b #=> false That's definitely a gotcha but I wouldn't necessarily say it's fucked up. It's just that Time#now returns the curren

Re: [rspec-users] Date comparisons

2008-05-05 Thread Pat Maddox
Yes, that was my first idea as well. The Time class is a little fucked up in that < a, b = Time.now, Time.now < a == b #=> false So if you're using Time anywhere, you really ought to be stubbing it. "always" :) Pat On Sun, May 4, 2008 at 11:07 PM, Aslak Hellesøy <[EMAIL PROTECTED]> wrote