Re: [rspec-users] spec-ing private methods?

2009-10-14 Thread Zach Dennis
On Wed, Oct 14, 2009 at 7:07 PM, Ashley Moran wrote: > > On 14 Oct 2009, at 22:48, Matt Wynne wrote: > >> By the way, Sprout Class comes from 'Working Effectively with Legacy Code' >> (Feathers), which is probably the best book I've read on TDD (Admittedly >> I've yet to read The RSpec Book). High

Re: [rspec-users] spec-ing private methods?

2009-10-14 Thread Ashley Moran
On 14 Oct 2009, at 22:48, Matt Wynne wrote: By the way, Sprout Class comes from 'Working Effectively with Legacy Code' (Feathers), which is probably the best book I've read on TDD (Admittedly I've yet to read The RSpec Book). Highly recommended. I've heard good things about this book too.

Re: [rspec-users] spec-ing private methods?

2009-10-14 Thread Matt Wynne
On 14 Oct 2009, at 22:33, Matt Wynne wrote: On 14 Oct 2009, at 20:49, Scott Taylor wrote: On Oct 14, 2009, at 3:36 PM, Joaquin Rivera Padron wrote: hello there, how do you tipically spec private methods? The thing is Ï have something like this: You have a few options: 1. Make the meth

Re: [rspec-users] spec-ing private methods?

2009-10-14 Thread Matt Wynne
On 14 Oct 2009, at 20:49, Scott Taylor wrote: On Oct 14, 2009, at 3:36 PM, Joaquin Rivera Padron wrote: hello there, how do you tipically spec private methods? The thing is Ï have something like this: You have a few options: 1. Make the method public in the object you are testing 2. Make

Re: [rspec-users] spec-ing private methods?

2009-10-14 Thread Joaquin Rivera Padron
hello 2009/10/14 Ashley Moran > On 14 Oct 2009, at 20:49, Scott Taylor wrote: > >> On Oct 14, 2009, at 3:36 PM, Joaquin Rivera Padron wrote: >> >> private >>> def complex_method... >>> def other_complex_methods ... >>> >>> and the two complex methods can get really tricky to get right, I would

Re: [rspec-users] spec-ing private methods?

2009-10-14 Thread Ashley Moran
On 14 Oct 2009, at 21:31, Stephen Eley wrote: I disagree that the simple existence of private methods is a sign of a design flaw. There are plenty of use cases for which private methods are the simplest and most practical approach. I use them all the time to help me deconstruct complicated mu

Re: [rspec-users] spec-ing private methods?

2009-10-14 Thread Scott Taylor
On Oct 14, 2009, at 4:24 PM, Nicolás Sanguinetti wrote: On Wed, Oct 14, 2009 at 5:49 PM, Scott Taylor wrote: On Oct 14, 2009, at 3:36 PM, Joaquin Rivera Padron wrote: hello there, how do you tipically spec private methods? The thing is Ï have something like this: def some_method com

Re: [rspec-users] spec-ing private methods?

2009-10-14 Thread Ashley Moran
On 14 Oct 2009, at 20:49, Scott Taylor wrote: On Oct 14, 2009, at 3:36 PM, Joaquin Rivera Padron wrote: private def complex_method... def other_complex_methods ... and the two complex methods can get really tricky to get right, I would like to be able to write specs for them, how do you do t

Re: [rspec-users] spec-ing private methods?

2009-10-14 Thread Stephen Eley
On Wed, Oct 14, 2009 at 3:49 PM, Scott Taylor wrote: > > Most of those options suck (esp. 1, 2, 3, & 4) - usually it represents a > design flaw (you are doing too much in your class). I disagree that the simple existence of private methods is a sign of a design flaw. There are plenty of use case

Re: [rspec-users] spec-ing private methods?

2009-10-14 Thread Nicolás Sanguinetti
On Wed, Oct 14, 2009 at 5:49 PM, Scott Taylor wrote: > > On Oct 14, 2009, at 3:36 PM, Joaquin Rivera Padron wrote: > > hello there, > how do you tipically spec private methods? The thing is Ï have something > like this: > > def some_method >    complex_method + other_complex_methods > end > > priv

Re: [rspec-users] spec-ing private methods?

2009-10-14 Thread Scott Taylor
On Oct 14, 2009, at 3:36 PM, Joaquin Rivera Padron wrote: hello there, how do you tipically spec private methods? The thing is Ï have something like this: def some_method complex_method + other_complex_methods end private def complex_method... def other_complex_methods ... and the two

[rspec-users] spec-ing private methods?

2009-10-14 Thread Joaquin Rivera Padron
hello there, how do you tipically spec private methods? The thing is Ï have something like this: def some_method complex_method + other_complex_methods end private def complex_method... def other_complex_methods ... and the two complex methods can get really tricky to get right, I would like

Re: [rspec-users] Model specs and ActiveRecord::TestCase

2009-10-14 Thread Elliot Winkler
Actually it seems someone read my mind... just tried out the patch in #896 and it seems to work great. So, problem solved ;) -- Elliot On 10/14/09 1:18 PM, David Chelimsky wrote: On Wed, Oct 14, 2009 at 3:01 PM, Elliot Winkler wrote: Is there any reason why the ModelExampleGroup in rspe

Re: [rspec-users] Model specs and ActiveRecord::TestCase

2009-10-14 Thread David Chelimsky
On Wed, Oct 14, 2009 at 3:01 PM, Elliot Winkler wrote: > Is there any reason why the ModelExampleGroup in rspec-rails inherits from > ActiveSupport::TestCase and not ActiveRecord::TestCase? I noticed this > because I tried to use assert_queries in one of my specs and obviously it > told me it didn

Re: [rspec-users] should and != operator

2009-10-14 Thread Ashley Moran
On 14 Oct 2009, at 17:01, Stephen Eley wrote: Did your brain try to warn you? You're part of the system, you know. >8-> Well I already know not to do `should !=`, so I don't do it. But I was suggesting that RSpec could make an AST pass over the specs to pick up this, which is undetect

[rspec-users] Model specs and ActiveRecord::TestCase

2009-10-14 Thread Elliot Winkler
Is there any reason why the ModelExampleGroup in rspec-rails inherits from ActiveSupport::TestCase and not ActiveRecord::TestCase? I noticed this because I tried to use assert_queries in one of my specs and obviously it told me it didn't know what that was. Not a huge problem, I can always add

Re: [rspec-users] should and != operator

2009-10-14 Thread Stephen Eley
On Wed, Oct 14, 2009 at 4:34 AM, Ashley Moran wrote: > On 14 Oct 2009, at 02:25, Stephen Eley wrote: > >> [...] these quirks are caught when your specs >> pass and you haven't done anything to make them pass yet.  >8-> > > Really?  I just tried `1.should != 2' and got no warnings. Did your brain

Re: [rspec-users] Resources on using RSpec with Sinatra

2009-10-14 Thread doug livesey
>From the Cucumber list, I was pointed to this: http://www.sinatrarb.com/testing.htmlAbout half way down, it details how to use Sinatra with RSpec. I've only had time for a glance, so I'm not sure how complete it is, but if I need to engage my brain at all when I get time to play with it, I'll take

Re: [rspec-users] Resources on using RSpec with Sinatra

2009-10-14 Thread David Chelimsky
On Wed, Oct 14, 2009 at 8:14 AM, doug livesey wrote: > Could anybody post resources on using RSpec with Sinatra? There's no official resource that I'm aware of, but google says there are over 2 million to choose from :) If anybody has specific resources they'd like to put focus on, feel free to

[rspec-users] Resources on using RSpec with Sinatra

2009-10-14 Thread doug livesey
Could anybody post resources on using RSpec with Sinatra?Thanks, Doug. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] should and != operator

2009-10-14 Thread Ashley Moran
On 14 Oct 2009, at 02:25, Stephen Eley wrote: The AST pass over the spec files already exists. It's what Ruby does when you run the specs, and these quirks are caught when your specs pass and you haven't done anything to make them pass yet. >8-> Really? I just tried `1.should != 2' and got