Re: [rspec-users] Specing exit codes

2007-10-06 Thread Mikel Lindsaar
Hey Scott, Thanks for the speedy answer dependency injection is new to me, so I am getting my head around it all. I put your solution in and now I am getting: 1) SystemExit in 'Init handling exit codes before(:all)' exit ./init.rb:8:in `exit' ./init.rb:8:in `initialize' 2) SystemExit in 'In

Re: [rspec-users] Specing exit codes

2007-10-06 Thread Scott Taylor
On Oct 6, 2007, at 11:31 PM, Mikel Lindsaar wrote: > I am writing a small ruby script that will be accepting input from > postfix's pipe command (ie, not running via the shell, directly > executing). > > One of the things I need to do it spec the exit codes to make sure I > am returing the correc

Re: [rspec-users] Spec/Test Speed

2007-10-06 Thread Scott Taylor
On Oct 7, 2007, at 1:47 AM, Pat Maddox wrote: > On 10/6/07, Scott Taylor <[EMAIL PROTECTED]> wrote: >> >> On Oct 7, 2007, at 12:31 AM, Chad Humphries wrote: >> >>> Scott, >>> >>> I don't really have a lot to contribute on how to make it faster, >>> other than to outline what we've been doing on o

Re: [rspec-users] Spec/Test Speed

2007-10-06 Thread Pat Maddox
On 10/6/07, Scott Taylor <[EMAIL PROTECTED]> wrote: > > On Oct 7, 2007, at 12:31 AM, Chad Humphries wrote: > > > Scott, > > > > I don't really have a lot to contribute on how to make it faster, > > other than to outline what we've been doing on our projects. > > > > On one of our current projects w

Re: [rspec-users] Spec/Test Speed

2007-10-06 Thread Scott Taylor
On Oct 7, 2007, at 12:31 AM, Chad Humphries wrote: > Scott, > > I don't really have a lot to contribute on how to make it faster, > other than to outline what we've been doing on our projects. > > On one of our current projects we have the following 2570 examples > that run in ~70 seconds on our

Re: [rspec-users] Spec/Test Speed

2007-10-06 Thread Chad Humphries
Scott, I don't really have a lot to contribute on how to make it faster, other than to outline what we've been doing on our projects. On one of our current projects we have the following 2570 examples that run in ~70 seconds on our pairing stations (mac minis, 1.83 c2d). In general across

[rspec-users] Specing exit codes

2007-10-06 Thread Mikel Lindsaar
I am writing a small ruby script that will be accepting input from postfix's pipe command (ie, not running via the shell, directly executing). One of the things I need to do it spec the exit codes to make sure I am returing the correct exit codes for each condition as Postfix will then return SMTP

Re: [rspec-users] Spec/Test Speed

2007-10-06 Thread Scott Taylor
On Oct 4, 2007, at 6:11 AM, Jerry West wrote: > In-memory with sqlite worked fine with rspec-0.8 (it's been a while > since I did this!). Google for instructions or drop me a line. Don't > forget autotest/zentest to run only those tests which have ben > affected > by changes. Actually, on m

Re: [rspec-users] Easy AR association stubbing

2007-10-06 Thread Pat Maddox
On 10/6/07, Andrew WC Brown <[EMAIL PROTECTED]> wrote: > But what if I need to use posts as such? > > @person = mock_model(Person) > @person.stub_association!(:posts, :find_by_title => mock_model(Post)) > > posts.stub!(:count).and_return(2) > > ___ > rspe

Re: [rspec-users] Easy AR association stubbing

2007-10-06 Thread Andrew WC Brown
But what if I need to use posts as such? @person = mock_model(Person) @person.stub_association!(:posts, :find_by_title => mock_model(Post)) posts.stub!(:count).and_return(2) ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mai

Re: [rspec-users] spec'ing views, mock_model associations

2007-10-06 Thread David Chelimsky
On 10/6/07, Andrew WC Brown <[EMAIL PROTECTED]> wrote: > I made it pass! Glad to be of help! > I just had to do some stubbing. > > @game = mock_model(Game, > :name => 'The Battle for Blaze', > :salt_grains => '500', > :people => '500', > :days => nil, > :

Re: [rspec-users] spec'ing views, mock_model associations

2007-10-06 Thread Andrew WC Brown
I made it pass! I just had to do some stubbing. @game = mock_model(Game, :name => 'The Battle for Blaze', :salt_grains => '500', :people => '500', :days => nil, :created_at => "Mon Oct 01 00:02:44 -0400 2007", :enabled => true) #player_1 = mock_

Re: [rspec-users] spec'ing views, mock_model associations

2007-10-06 Thread Andrew WC Brown
Oh so I have to mock post_proxy. I think I'm getting closer @game = mock_model(Game, :name => 'The Battle for Blaze', :salt_grains => '500', :people => '500', :days => nil, :created_at => "Mon Oct 01 00:02:44 -0400 2007", :enabled => true) #play

Re: [rspec-users] spec'ing views, mock_model associations

2007-10-06 Thread Andrew WC Brown
I for some reason think I would use stub such as: @game = mock_model(Game, :name => 'The Battle for Blaze', :salt_grains => '500', :people => '500', :days => nil, :created_at => "Mon Oct 01 00:02:44 -0400 2007", :enabled => true) player_1 = mock

[rspec-users] spec'ing views, mock_model associations

2007-10-06 Thread Andrew WC Brown
I writing a spec that returns the count of how many players in a game: it "should how many players in a link to all players" do render :partial =>"games/game", :object => @game response.should have_tag('a',"(2) Players") end I'm not sure how to do the mock model, I think it would be done two wa

[rspec-users] [OT] - Overriding a rake task - Re: NO NAME (Because of --dry-run) output

2007-10-06 Thread Scott Taylor
On Oct 6, 2007, at 10:21 AM, David Chelimsky wrote: > On 10/6/07, Joshua Schairbaum <[EMAIL PROTECTED]> wrote: >> I'm just getting started with rspec, I'm running on edge for >> both. In >> a fresh project, I freeze edge, install the edge rspec plugin. I >> generate a simple rspec_model and r

Re: [rspec-users] NO NAME (Because of --dry-run) output

2007-10-06 Thread David Chelimsky
On 10/6/07, Joshua Schairbaum <[EMAIL PROTECTED]> wrote: > I'm just getting started with rspec, I'm running on edge for both. In > a fresh project, I freeze edge, install the edge rspec plugin. I > generate a simple rspec_model and run the spec. It passes. When I > run rake spec:doc, I get the

[rspec-users] NO NAME (Because of --dry-run) output

2007-10-06 Thread Joshua Schairbaum
I'm just getting started with rspec, I'm running on edge for both. In a fresh project, I freeze edge, install the edge rspec plugin. I generate a simple rspec_model and run the spec. It passes. When I run rake spec:doc, I get the following output: - NO NAME (Because of --dry-run) where the spec

Re: [rspec-users] spec'ing view render partial collection, local variable not found

2007-10-06 Thread Andrew WC Brown
I outputted name and enabled to see if it the mock object was working. before do game = mock_model(Game, :name => 'The Battle for Blaze', :enabled => 'true') puts game.name puts game.enabled game.should_receive(:name).and_return('The Battle for Blaze') game.should_receive(:enabled).and_r