Re: [rspec-users] Role of stories vs specs, revisited

2008-01-11 Thread Jay Donnell
> If you were to rename deposit to credit, and withdraw to debit I'm more concerned with adding a parameter or changing the default value of a parameter. My fear is that given enough time and size there will be a fair number of inconsistent mocks or mocks that aren't doing any real testing. It

Re: [rspec-users] Role of stories vs specs, revisited

2008-01-11 Thread Pat Maddox
On Jan 11, 2008 5:11 PM, Jay Donnell <[EMAIL PROTECTED]> wrote: > >> The thing is that, ideally, you don't want to have to make changes to > >> the tests for object A when you're refactoring B. > >> > >> WDYT? > > > Yeah, I buy that. Not everyone does though. Or at least not everyone > > feels th

Re: [rspec-users] Role of stories vs specs, revisited

2008-01-11 Thread Jay Donnell
>> The thing is that, ideally, you don't want to have to make changes to >> the tests for object A when you're refactoring B. >> >> WDYT? > Yeah, I buy that. Not everyone does though. Or at least not everyone > feels that it's a particularly important goal. I think the fear many of us classicis

Re: [rspec-users] Role of stories vs specs, revisited

2008-01-11 Thread Pat Maddox
On Jan 11, 2008 1:48 PM, David Chelimsky <[EMAIL PROTECTED]> wrote: > On Jan 11, 2008 3:43 PM, Pat Maddox <[EMAIL PROTECTED]> wrote: > > I don't have any problem with that. I do things that way, and I get > > my work done just fine. However, I'm having a tough time clarifying > > my position when

Re: [rspec-users] Role of stories vs specs, revisited

2008-01-11 Thread David Chelimsky
On Jan 11, 2008 3:43 PM, Pat Maddox <[EMAIL PROTECTED]> wrote: > I'm going to hijack this a bit :) > > On Jan 11, 2008 1:25 PM, David Chelimsky <[EMAIL PROTECTED]> wrote: > > > > But the target of stories are system level descriptions of behaviour. > > This will inevitably appear to have some overl

Re: [rspec-users] Role of stories vs specs, revisited

2008-01-11 Thread Pat Maddox
I'm going to hijack this a bit :) On Jan 11, 2008 1:25 PM, David Chelimsky <[EMAIL PROTECTED]> wrote: > > But the target of stories are system level descriptions of behaviour. > This will inevitably appear to have some overlap with the specs for > the outermost layers of the system. But when you s

Re: [rspec-users] Missing methods

2008-01-11 Thread James Deville
On Jan 11, 2008, at 7:31 AM, Scott Taylor wrote: > > On Jan 10, 2008, at 8:27 PM, James Deville wrote: > >> We have a custom implementation of the Mother Object idea. It's >> inside >> of a module, basically like this: >> >> module Factory >> %w(account friendship person invitation message

Re: [rspec-users] Role of stories vs specs, revisited

2008-01-11 Thread David Chelimsky
On Jan 11, 2008 3:16 PM, Pat Maddox <[EMAIL PROTECTED]> wrote: > A couple months ago I asked how stories and specs might impact each > other. [1]If you look at Dan North's example of what's in a story > [2], and you imagine using the spec framework to drive the design, you > can probably imagin

[rspec-users] Role of stories vs specs, revisited

2008-01-11 Thread Pat Maddox
A couple months ago I asked how stories and specs might impact each other. [1]If you look at Dan North's example of what's in a story [2], and you imagine using the spec framework to drive the design, you can probably imagine a significant bit of overlap in the two. Is that a bad thing? I'm n

Re: [rspec-users] specs on private methods

2008-01-11 Thread Jarkko Laine
On Jan 11, 2008, at 5:54 PM, Ben Mabey <[EMAIL PROTECTED]> wrote: > David Chelimsky wrote: >> >> >> In TDD there is a rule of thumb that says don't stub a method in the >> same class as the method you're testing. The risk is that as the real >> implementation of by_input_sets!() changes over tim

Re: [rspec-users] Varying test data

2008-01-11 Thread aslak hellesoy
On Jan 11, 2008 11:33 AM, Kerry Buckley <[EMAIL PROTECTED]> wrote: > This isn't specific to RSpec, but is hopefully on-topic for this list. > > I like (especially when "ping pong pairing") to write a spec, then > write the smallest amount of code I can to pass it (especially when > "ping pong pairi

Re: [rspec-users] specs on private methods

2008-01-11 Thread Zach Dennis
On Jan 11, 2008 12:56 PM, Cody P. Skidmore <[EMAIL PROTECTED]> wrote: > Thank you Zach. I was just about to ask about this. I'm just getting > started with restful_authentication and have missed the context of your > point. restful_authentication is such a huge improvement over what I'm > use to

Re: [rspec-users] specs on private methods

2008-01-11 Thread Cody P. Skidmore
Thank you Zach. I was just about to ask about this. I'm just getting started with restful_authentication and have missed the context of your point. restful_authentication is such a huge improvement over what I'm use to. Could you elaborate just a little on the use context in controllers? Is th

Re: [rspec-users] specs on private methods

2008-01-11 Thread Zach Dennis
To add, all of our managers return LoginResult objects which contain methods like: - successful? - user - message In the controller our code will look like: if login.successful? self.current_user = login.user else flash[:error] = login.message end This has worked well because it allows e

Re: [rspec-users] specs on private methods

2008-01-11 Thread Zach Dennis
We pass the required items in as method arguments. In the spirit of sharing code and getting people to review code. Here is our current LoginManager: class LoginManager include Injection inject :invitation_manager def login_from_cookie(cookies, session) CookieLoginManager.new( :co

Re: [rspec-users] specs on private methods

2008-01-11 Thread Ben Mabey
Zach Dennis wrote: > On Jan 11, 2008 11:56 AM, David Chelimsky <[EMAIL PROTECTED]> wrote: > >> On Jan 11, 2008 9:54 AM, Ben Mabey <[EMAIL PROTECTED]> wrote: >> >>> David Chelimsky wrote: >>> In TDD there is a rule of thumb that says don't stub a method in the same class as

Re: [rspec-users] specs on private methods

2008-01-11 Thread David Chelimsky
On Jan 11, 2008 11:40 AM, Zach Dennis <[EMAIL PROTECTED]> wrote: > On Jan 11, 2008 11:56 AM, David Chelimsky <[EMAIL PROTECTED]> wrote: > > On Jan 11, 2008 9:54 AM, Ben Mabey <[EMAIL PROTECTED]> wrote: > > > David Chelimsky wrote: > > > > > > > > > > > > In TDD there is a rule of thumb that says do

Re: [rspec-users] specs on private methods

2008-01-11 Thread Zach Dennis
On Jan 11, 2008 11:56 AM, David Chelimsky <[EMAIL PROTECTED]> wrote: > On Jan 11, 2008 9:54 AM, Ben Mabey <[EMAIL PROTECTED]> wrote: > > David Chelimsky wrote: > > > > > > > > > In TDD there is a rule of thumb that says don't stub a method in the > > > same class as the method you're testing. The r

Re: [rspec-users] changes in rspec's trunk and autotest

2008-01-11 Thread David Chelimsky
On Jan 11, 2008 11:36 AM, Tim Glen <[EMAIL PROTECTED]> wrote: > very cool. > > Funny enough, I never knew this functionality even existed - it was > just getting clobbered all this time. It's only in the last release or two. > Now I see ~10 files that actually need specs, which were totally > get

Re: [rspec-users] changes in rspec's trunk and autotest

2008-01-11 Thread Tim Glen
very cool. Funny enough, I never knew this functionality even existed - it was just getting clobbered all this time. Now I see ~10 files that actually need specs, which were totally getting missed before! thanks, tim On 11-Jan-08, at 10:56 AM, David Chelimsky wrote: > On Jan 11, 2008 9:52 A

Re: [rspec-users] specs on private methods

2008-01-11 Thread David Chelimsky
On Jan 11, 2008 9:54 AM, Ben Mabey <[EMAIL PROTECTED]> wrote: > David Chelimsky wrote: > > > > > > In TDD there is a rule of thumb that says don't stub a method in the > > same class as the method you're testing. The risk is that as the real > > implementation of by_input_sets!() changes over time,

Re: [rspec-users] Varying test data

2008-01-11 Thread David Chelimsky
On Jan 11, 2008 10:19 AM, Jonathan Linowes <[EMAIL PROTECTED]> wrote: > > On Jan 11, 2008, at 5:50 AM, David Chelimsky wrote: > > > Apparently, Pat and I are twins separated at birth. > > Would it then be correct to refactor and eliminate one of them?? If you could argue that we were ultimately co

Re: [rspec-users] Varying test data

2008-01-11 Thread Nathan Sutton
We're clearly at green! Nathan Sutton [EMAIL PROTECTED] rspec 1.1 rspec_on_rails 1.1 rails 2.0.2 On Jan 11, 2008, at 10:19 AM, Jonathan Linowes wrote: > > On Jan 11, 2008, at 5:50 AM, David Chelimsky wrote: > >> Apparently, Pat and I are twins separated at birth. > > > Would it then be correct t

Re: [rspec-users] Varying test data

2008-01-11 Thread Jonathan Linowes
On Jan 11, 2008, at 5:50 AM, David Chelimsky wrote: > Apparently, Pat and I are twins separated at birth. Would it then be correct to refactor and eliminate one of them?? :)) ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org

Re: [rspec-users] changes in rspec's trunk and autotest

2008-01-11 Thread David Chelimsky
On Jan 11, 2008 9:52 AM, David Chelimsky <[EMAIL PROTECTED]> wrote: > On Jan 11, 2008 9:45 AM, Tim Glen <[EMAIL PROTECTED]> wrote: > > since i'm on rspec trunk, I applied your patch and ran into a little > > issue. All my specs still run but it seems to be looking at and > > "attempting" all of my

Re: [rspec-users] specs on private methods

2008-01-11 Thread Ben Mabey
David Chelimsky wrote: > > > In TDD there is a rule of thumb that says don't stub a method in the > same class as the method you're testing. The risk is that as the real > implementation of by_input_sets!() changes over time, it has access to > internal state that could impact the behaviour of deco

Re: [rspec-users] changes in rspec's trunk and autotest

2008-01-11 Thread David Chelimsky
On Jan 11, 2008 9:45 AM, Tim Glen <[EMAIL PROTECTED]> wrote: > since i'm on rspec trunk, I applied your patch and ran into a little > issue. All my specs still run but it seems to be looking at and > "attempting" all of my hidden files and directories (and some other > stuff too?): > > Dunno! Capf

Re: [rspec-users] changes in rspec's trunk and autotest

2008-01-11 Thread Tim Glen
since i'm on rspec trunk, I applied your patch and ran into a little issue. All my specs still run but it seems to be looking at and "attempting" all of my hidden files and directories (and some other stuff too?): Dunno! Capfile Dunno! app/helpers/.svn/format Dunno! app/views/sales/.svn/text

Re: [rspec-users] specs on private methods

2008-01-11 Thread Zach Dennis
On Jan 11, 2008 5:23 AM, David Chelimsky <[EMAIL PROTECTED]> wrote: > On Jan 11, 2008 3:49 AM, Shot (Piotr Szotkowski) <[EMAIL PROTECTED]> wrote: > > Daniel Tenner: > > > > > Might be a personal thing, but my approach is that I try to test the > > > public behaviour of the object. Testing private m

Re: [rspec-users] Missing methods

2008-01-11 Thread Scott Taylor
On Jan 10, 2008, at 8:27 PM, James Deville wrote: > We have a custom implementation of the Mother Object idea. It's inside > of a module, basically like this: > > module Factory > %w(account friendship person invitation message asset email_address > birth).each do |klass| > ev

Re: [rspec-users] specs on private methods

2008-01-11 Thread David Chelimsky
On Jan 11, 2008 8:04 AM, Shot (Piotr Szotkowski) <[EMAIL PROTECTED]> wrote: > David Chelimsky: > > > On Jan 11, 2008 3:49 AM, Shot (Piotr Szotkowski) <[EMAIL PROTECTED]> wrote: > > >> One run of by_input_sets!() takes a couple of seconds, so can > >> be tested; one run of decompose!() takes much lo

Re: [rspec-users] specs on private methods

2008-01-11 Thread Shot (Piotr Szotkowski)
David Chelimsky: > On Jan 11, 2008 3:49 AM, Shot (Piotr Szotkowski) <[EMAIL PROTECTED]> wrote: >> One run of by_input_sets!() takes a couple of seconds, so can >> be tested; one run of decompose!() takes much longer, so to test >> decompose!() I should stub by_input_sets!() so it returns canned >

Re: [rspec-users] Varying test data

2008-01-11 Thread Kerry Buckley
On 11 Jan 2008, at 10:50, David Chelimsky wrote: > On Jan 11, 2008 4:48 AM, Pat Maddox <[EMAIL PROTECTED]> wrote: >> >> > > Apparently, Pat and I are twins separated at birth. Thanks both! Kerry ___ rspec-users mailing list rspec-users@rubyforge.org h

Re: [rspec-users] Varying test data

2008-01-11 Thread Pat Maddox
On Jan 11, 2008 2:50 AM, David Chelimsky <[EMAIL PROTECTED]> wrote: > > On Jan 11, 2008 4:48 AM, Pat Maddox <[EMAIL PROTECTED]> wrote: > > > > On Jan 11, 2008 2:33 AM, Kerry Buckley <[EMAIL PROTECTED]> wrote: > > > This isn't specific to RSpec, but is hopefully on-topic for this list. > > > > > > I

Re: [rspec-users] Varying test data

2008-01-11 Thread David Chelimsky
On Jan 11, 2008 4:48 AM, Pat Maddox <[EMAIL PROTECTED]> wrote: > > On Jan 11, 2008 2:33 AM, Kerry Buckley <[EMAIL PROTECTED]> wrote: > > This isn't specific to RSpec, but is hopefully on-topic for this list. > > > > I like (especially when "ping pong pairing") to write a spec, then > > write the sm

Re: [rspec-users] Varying test data

2008-01-11 Thread David Chelimsky
On Jan 11, 2008 4:33 AM, Kerry Buckley <[EMAIL PROTECTED]> wrote: > This isn't specific to RSpec, but is hopefully on-topic for this list. > > I like (especially when "ping pong pairing") to write a spec, then > write the smallest amount of code I can to pass it (especially when > "ping pong pairin

Re: [rspec-users] Varying test data

2008-01-11 Thread Pat Maddox
On Jan 11, 2008 2:33 AM, Kerry Buckley <[EMAIL PROTECTED]> wrote: > This isn't specific to RSpec, but is hopefully on-topic for this list. > > I like (especially when "ping pong pairing") to write a spec, then > write the smallest amount of code I can to pass it (especially when > "ping pong pairin

[rspec-users] Varying test data

2008-01-11 Thread Kerry Buckley
This isn't specific to RSpec, but is hopefully on-topic for this list. I like (especially when "ping pong pairing") to write a spec, then write the smallest amount of code I can to pass it (especially when "ping pong pairing"). Sometimes this means hard-coding a return value, which means ano

Re: [rspec-users] specs on private methods

2008-01-11 Thread David Chelimsky
On Jan 11, 2008 3:49 AM, Shot (Piotr Szotkowski) <[EMAIL PROTECTED]> wrote: > Daniel Tenner: > > > Might be a personal thing, but my approach is that I try to test the > > public behaviour of the object. Testing private methods is, imho, > > getting dangerously close to specifying how the object do

Re: [rspec-users] Story teardowns?

2008-01-11 Thread Andreas Axelsson
> > Does the plain text story framework support teardowns? There doesn't > seem to > > be anywhere to put an "after" method. My stories test an application > which > > parses and modifies a directory tree, which is currently generated in > a > > Given-clause, and I want it to be deleted after each

Re: [rspec-users] Story teardowns?

2008-01-11 Thread aslak hellesoy
On Jan 11, 2008 10:53 AM, Andreas Axelsson <[EMAIL PROTECTED]> wrote: > > > > > Does the plain text story framework support teardowns? There doesn't seem to > be anywhere to put an "after" method. My stories test an application which > parses and modifies a directory tree, which is currently genera

[rspec-users] Story teardowns?

2008-01-11 Thread Andreas Axelsson
Does the plain text story framework support teardowns? There doesn't seem to be anywhere to put an "after" method. My stories test an application which parses and modifies a directory tree, which is currently generated in a Given-clause, and I want it to be deleted after each story. (I don't min

Re: [rspec-users] specs on private methods

2008-01-11 Thread Shot (Piotr Szotkowski)
Daniel Tenner: > Might be a personal thing, but my approach is that I try to test the > public behaviour of the object. Testing private methods is, imho, > getting dangerously close to specifying how the object does its > business, rather than what it does. I agree on principle, but I ran into th