Re: [rspec-users] Can I set params in before[:each] block?

2009-06-12 Thread Lee
Makes perfect sense. Thanks for the tip Matt! On 12 June, 09:43, Matt Wynne wrote: > On 12 Jun 2009, at 08:34, Lee wrote: > > > > > In my controller's create method, I have: > > > @sub_context = @context.create_sub_context(params[:context][:name]) > > > If I do not specify params in the "post :cr

Re: [rspec-users] I am having a problem testing a date in a rails view

2009-06-12 Thread powertoaster
This is not an rspec failure message. What other gems do you have at play? Also, what versions of rspec, rspec-rails, ruby, rails, OS, etc? http://wiki.github.com/dchelimsky/rspec/get-in-touch Rails 2.3.2 Ruby 1.8 Rspec 1.2.6 calendar_date_select 1.15 (I am not using this on the index page) va

Re: [rspec-users] The problem with learning RSpec

2009-06-12 Thread Stephen Eley
Ben and Rick, Thanks very much to both of you for the encouraging responses. Your reply, Ben, came just in time as I was starting to wonder if I had made a complete and irrevocable ass of myself. On Fri, Jun 12, 2009 at 10:36 AM, Ben Mabey wrote: > In general though I don't know if I > really s

Re: [rspec-users] The problem with learning RSpec

2009-06-12 Thread Ben Mabey
I'm rambling now, and I've spent *way* too much of my workday on this message, so I'll just summarize: * Some easy things are complicated in RSpec; * Incomplete understanding of RSpec and a framework being spec'ed can create learning deadlock; * Novices need different answers than competent pra

Re: [rspec-users] Mock and Stub objects

2009-06-12 Thread David Chelimsky
On Fri, Jun 12, 2009 at 4:46 AM, Amit Kulkarni wrote: > Even if we are using mocks and if our models are changed then also we > need to change our spec. > Same for if we don't use mocks. This is true in some cases, but not in many of the common cases. Here's an example: describe WidgetsController

Re: [rspec-users] Autospec Infinite Loop ??

2009-06-12 Thread David Chelimsky
On Fri, Jun 12, 2009 at 6:42 AM, Alexandre Da Silva wrote: > Jarmo Pertman wrote: >> Do you have any files, which might be changed during your failing >> tests? Some temporary files or whatsoever? If that's the case, then >> autotest thinks that you have made some changes already and tries to >> ru

Re: [rspec-users] Autospec Infinite Loop ??

2009-06-12 Thread Maurício Linhares
Same for me. - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Fri, Jun 12, 2009 at 10:59 AM, Bart Zonneveld wrote: > > On 12 jun 2009, at 13:42, Alexandre Da Silva wrote: > >> Jarmo Pertman wrote: >>> >>> Do you have any files, which might be changed duri

Re: [rspec-users] Autospec Infinite Loop ??

2009-06-12 Thread Alexandre Da Silva
Bart Zonneveld wrote: > On 12 jun 2009, at 13:42, Alexandre Da Silva wrote: > >> Jarmo Pertman wrote: >>> Do you have any files, which might be changed during your failing >>> tests? Some temporary files or whatsoever? If that's the case, then >>> autotest thinks that you have made some changes al

Re: [rspec-users] Problem while generating rspec model in Rails Project

2009-06-12 Thread David Chelimsky
On Fri, Jun 12, 2009 at 5:35 AM, Ninad Pol wrote: > > Hi, > > I am new to testing and Rspec. I have one rails project created on my > machine. > In this project under \app\models i have a file called "client.rb" which > has been already created. Now i want to generate spec file for this > model for

Re: [rspec-users] Autospec Infinite Loop ??

2009-06-12 Thread Bart Zonneveld
On 12 jun 2009, at 13:42, Alexandre Da Silva wrote: Jarmo Pertman wrote: Do you have any files, which might be changed during your failing tests? Some temporary files or whatsoever? If that's the case, then autotest thinks that you have made some changes already and tries to run again. Solutio

Re: [rspec-users] Autospec Infinite Loop ??

2009-06-12 Thread Alexandre Da Silva
Jarmo Pertman wrote: > Do you have any files, which might be changed during your failing > tests? Some temporary files or whatsoever? If that's the case, then > autotest thinks that you have made some changes already and tries to > run again. Solution would be to put that file into ignore list for

[rspec-users] Problem while generating rspec model in Rails Project

2009-06-12 Thread Ninad Pol
Hi, I am new to testing and Rspec. I have one rails project created on my machine. In this project under \app\models i have a file called "client.rb" which has been already created. Now i want to generate spec file for this model for which i am using command: ruby script/generate rspec_model Cli

Re: [rspec-users] Mock and Stub objects

2009-06-12 Thread Amit Kulkarni
Even if we are using mocks and if our models are changed then also we need to change our spec. Same for if we don't use mocks. So same question i am asking Are mocks really useful? Also When to use if at all we want to use? I searched on net regarding the same but till now no success :-) Also i

Re: [rspec-users] Can I set params in before[:each] block?

2009-06-12 Thread Matt Wynne
On 12 Jun 2009, at 08:34, Lee wrote: In my controller's create method, I have: @sub_context = @context.create_sub_context(params[:context][:name]) If I do not specify params in the "post :create" call in my controller spec then I get the following error for each example: You have a nil objec

[rspec-users] Can I set params in before[:each] block?

2009-06-12 Thread Lee
In my controller's create method, I have: @sub_context = @context.create_sub_context(params[:context][:name]) If I do not specify params in the "post :create" call in my controller spec then I get the following error for each example: You have a nil object when you didn't expect it! You might ha

Re: [rspec-users] Autospec Infinite Loop ??

2009-06-12 Thread Jarmo Pertman
Do you have any files, which might be changed during your failing tests? Some temporary files or whatsoever? If that's the case, then autotest thinks that you have made some changes already and tries to run again. Solution would be to put that file into ignore list for autotest. On Jun 10, 6:28 am