[rspec-users] Mocking Rails association collections

2007-07-18 Thread Paul
Rails model association collections allow you to do nifty things like: article.comments.find(:all, :conditions = {:created_at 1.day.ago}) Has anyone found a good way to mock this up? I'm currently doing this: @comment1 = mock_model(Comment) comments = mock(Array)

Re: [rspec-users] Mocking Rails association collections

2007-07-18 Thread David Chelimsky
On 7/18/07, Paul [EMAIL PROTECTED] wrote: Rails model association collections allow you to do nifty things like: article.comments.find(:all, :conditions = {:created_at 1.day.ago}) Has anyone found a good way to mock this up? I'm currently doing this: @comment1 = mock_model(Comment)

[rspec-users] stopping on first failure

2007-07-18 Thread Esad Hajdarevic
Hi! Is there an option that I could provide to the spec runner that would make it stop after it encounters the first spec that fails? Esad ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Rails - Mock going out of scope?

2007-07-18 Thread David Chelimsky
On 7/18/07, Mikel Lindsaar [EMAIL PROTECTED] wrote: Hello list, I think I have a rails related RSpec problem with a mock going out of scope on a recursive call to a model. The code is at: http://pastie.textmate.org/79821 if you want to see it highlighted. I have pasted it below as well.

Re: [rspec-users] need help getting a word right

2007-07-18 Thread Kyle Hargraves
David Chelimsky wrote: Consise? Yes. But I'm not psyched about 'specify' either. There IS a perfect word for this situation. What is it? Suggestions? Personally, I disagree. For examples like that, I think 'specify' is a pretty ideal word. It reads exactly as I want it to. Depending on what

Re: [rspec-users] Rails - Mock going out of scope?

2007-07-18 Thread David Chelimsky
Here are the errors I'm getting now: 1) NoMethodError in 'Node instance should return it's parent's language if it is a child' undefined method `move_to_child_of' for #Node:0x34d3110 ./spec/models/node_spec.rb:20: 2) NameError in 'Node instance should return it's own language if it is root'

Re: [rspec-users] Rails - Mock going out of scope?

2007-07-18 Thread Mikel Lindsaar
Crap, I totally, forgot to mention, sorry David. I am using betternestedset http://wiki.rubyonrails.org/rails/pages/BetterNestedSet script/plugin source svn://rubyforge.org/var/svn/betternestedset script/plugin install betternestedset Regards Mikel On 7/19/07, David Chelimsky [EMAIL