Re: [rspec-users] do I use mocking (vs fixtures) for methods that produce results based on non-trivial SQL queries

2008-09-05 Thread Matt Wynne
On 5 Sep 2008, at 16:40, Ben Mabey wrote: Also - have you found a CI server that is working with git? On github you can find forks of cc.rb with added git support. I have been using it like a charm for months. In fact, the main thoughtworks github ccrb repo works with git now - we swit

Re: [rspec-users] Failing in TextMate but not in rake...

2008-09-05 Thread Hunt Jon
http://wiki.macromates.com/Troubleshooting/RubyVersionIssue Hope this helps. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] issue with application controller spec

2008-09-05 Thread Scott Taylor
On Sep 5, 2008, at 10:18 PM, Craig P Jolicoeur wrote: I'm having some trouble trying to spec some methods in my Rails application controller. I'm new to rspec converting over from straight test::unit. Here is the method in my application.rb controller that I'm trying to spec def render

Re: [rspec-users] do I use mocking (vs fixtures) for methods that produce results based on non-trivial SQL queries

2008-09-05 Thread Scott Taylor
On Sep 5, 2008, at 3:39 PM, Greg Hauptmann wrote: Ben - I like your suggestion, thanks. I'll start trying to structure some of my tests around this concept until there's a better way. Mark - I'm curious to understand what you actually do re "I personally do not use fixtures because my model s

Re: [rspec-users] Failing in TextMate but not in rake...

2008-09-05 Thread Greg Hauptmann
I'm getting the same error & also trying to work this out. Any advice welcomed -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Mocking a 3rd party call, but with a few exceptions

2008-09-05 Thread Pat Maddox
On Fri, Sep 5, 2008 at 2:15 PM, Christopher Bailey <[EMAIL PROTECTED]> wrote: > I use geocoding in our app, and it permeates most of the core functionality. > Because it makes a call out to Google or Yahoo or what not to do the > geocoding, I'd like to mock this for the bulk of my tests, except fo

Re: [rspec-users] do I use mocking (vs fixtures) for methods that produce results based on non-trivial SQL queries

2008-09-05 Thread Pat Maddox
> In fact, fixtures can get in the way, which is why you'll see > Video.delete_all in a lot of our before(:each)'s (often accompanied by > acerbic comments about "fixture bullshit.") Someone on your team has quite the potty mouth! :O ;) But seriously. Rails-style fixtures suck. You should be c

[rspec-users] issue with application controller spec

2008-09-05 Thread Craig P Jolicoeur
I'm having some trouble trying to spec some methods in my Rails application controller. I'm new to rspec converting over from straight test::unit. Here is the method in my application.rb controller that I'm trying to spec def render_403 logger.debug "Returned 403: #{request.request_u

Re: [rspec-users] 2nd attempt at mocking and stubbing

2008-09-05 Thread David Chelimsky
On Fri, Sep 5, 2008 at 4:44 PM, Nick Hoffman <[EMAIL PROTECTED]> wrote: > So, after reading all of those fantastic emails discussing testing behaviour > vs state, I decided to try mocking and stubbing a couple of methods. I think > I did well on my first one, but I'm not sure what the best way to s

Re: [rspec-users] 2nd attempt at mocking and stubbing

2008-09-05 Thread Jonathan Linowes
On Sep 5, 2008, at 5:44 PM, Nick Hoffman wrote: Property.stub!(:find).and_return mock_property1, mock_property2 try Property.stub!(:find).and_return( [mock_property1, mock_property2] ) Want to help others? Become a certified physic

[rspec-users] 2nd attempt at mocking and stubbing

2008-09-05 Thread Nick Hoffman
So, after reading all of those fantastic emails discussing testing behaviour vs state, I decided to try mocking and stubbing a couple of methods. I think I did well on my first one, but I'm not sure what the best way to spec the following method is: 1 class RentalMap ... 166 def add_

Re: [rspec-users] do I use mocking (vs fixtures) for methods that produce results based on non-trivial SQL queries

2008-09-05 Thread Mark Wilden
On Fri, Sep 5, 2008 at 12:39 PM, Greg Hauptmann < [EMAIL PROTECTED]> wrote: >Did you just mean that at the start of a test you create test data > in the database programmatically, as opposed to hard wiring it in a > fixture? > Yes, that's right. Our code has a lot of support for creating netw

[rspec-users] Mocking a 3rd party call, but with a few exceptions

2008-09-05 Thread Christopher Bailey
I use geocoding in our app, and it permeates most of the core functionality. Because it makes a call out to Google or Yahoo or what not to do the geocoding, I'd like to mock this for the bulk of my tests, except for the few tests that actually do stuff where they need the real data. I had started

Re: [rspec-users] scenarios on production data

2008-09-05 Thread Nick Hoffman
On 2008-09-05, at 14:14, Jonathan Linowes wrote: it just seems to me that while i'm running my tests on toy data sets, it could be reassuring to see the same run on real production data. Or, maybe not. I agree its not real scientific, but neither is the weather... :) (aka, shit happens)

Re: [rspec-users] do I use mocking (vs fixtures) for methods that produce results based on non-trivial SQL queries

2008-09-05 Thread Greg Hauptmann
Ben - I like your suggestion, thanks. I'll start trying to structure some of my tests around this concept until there's a better way. Mark - I'm curious to understand what you actually do re "I personally do not use fixtures because my model specs usually don't use a "typical" data set. I'll crea

Re: [rspec-users] Four Question From an RSpec Baby - Give me something to chew

2008-09-05 Thread Dan North
I think that's one of the nicest descriptions of the value of outside-in I've seen. Thanks Zach. 2008/9/5 Zach Dennis <[EMAIL PROTECTED]> > On Thu, Sep 4, 2008 at 7:14 PM, Nick Hoffman <[EMAIL PROTECTED]> wrote: > > On 2008-08-27, at 15:25, Mark Wilden wrote: > >> > >> The other thing I would sa

Re: [rspec-users] scenarios on production data

2008-09-05 Thread Jonathan Linowes
On Sep 5, 2008, at 1:27 PM, Mark Wilden wrote: On Fri, Sep 5, 2008 at 9:11 AM, Jonathan Linowes <[EMAIL PROTECTED]> wrote: That is, if my stories run with my well controlled, relatively small setups, I'd like to ensure they run on a large, fully populated, somewhat 'random' set of real d

Re: [rspec-users] scenarios on production data

2008-09-05 Thread Mark Wilden
On Fri, Sep 5, 2008 at 9:11 AM, Jonathan Linowes <[EMAIL PROTECTED]>wrote: > That is, if my stories run with my well controlled, relatively small > setups, I'd like to ensure they run on a large, fully populated, somewhat > 'random' set of real data. If you think there are situations where that

Re: [rspec-users] do I use mocking (vs fixtures) for methods that produce results based on non-trivial SQL queries

2008-09-05 Thread Ben Mabey
Scott Taylor wrote: > > On Sep 5, 2008, at 11:40 AM, Ben Mabey wrote: > >> Scott Taylor wrote: >>> >>> On Sep 5, 2008, at 10:55 AM, Pat Maddox wrote: >>> > time. Just do the math: If one database test takes 0.2 sec (a > realistic > figure), then 5 will take 1 sec, at 1000 over 3 minute

Re: [rspec-users] scenarios on production data

2008-09-05 Thread Ben Mabey
Jonathan Linowes wrote: > > On Sep 5, 2008, at 11:50 AM, Ashley Moran wrote: > >> >> On 4 Sep 2008, at 18:55, Jonathan Linowes wrote: >> >>> I'm just thinking out loud here... >>> It could be useful to have a way to run scenarios on a copy of a >>> fully populated production database, as an alterna

Re: [rspec-users] scenarios on production data

2008-09-05 Thread Jonathan Linowes
On Sep 5, 2008, at 11:50 AM, Ashley Moran wrote: On 4 Sep 2008, at 18:55, Jonathan Linowes wrote: I'm just thinking out loud here... It could be useful to have a way to run scenarios on a copy of a fully populated production database, as an alternative to normal use. Not sure how that'd wo

Re: [rspec-users] do I use mocking (vs fixtures) for methods that produce results based on non-trivial SQL queries

2008-09-05 Thread Scott Taylor
On Sep 5, 2008, at 11:40 AM, Ben Mabey wrote: Scott Taylor wrote: On Sep 5, 2008, at 10:55 AM, Pat Maddox wrote: time. Just do the math: If one database test takes 0.2 sec (a realistic figure), then 5 will take 1 sec, at 1000 over 3 minutes, and at 2000 over 6 minutes. This is starting

Re: [rspec-users] Four Question From an RSpec Baby - Give me something to chew

2008-09-05 Thread Nick Hoffman
Ben and Pat, your descriptions, explanations, and examples were awesome. I'm beginning to see why and how mocks and stubs are useful, and when they should be used. As I mentioned to Mark and Zach, I'm going to take a couple of days to re-read all of your emails and have this info settle, tr

Re: [rspec-users] scenarios on production data

2008-09-05 Thread Ashley Moran
On 4 Sep 2008, at 18:55, Jonathan Linowes wrote: I'm just thinking out loud here... It could be useful to have a way to run scenarios on a copy of a fully populated production database, as an alternative to normal use. Not sure how that'd work, maybe replace the Given's but leave the Whens

Re: [rspec-users] Make classes in a module available to examples

2008-09-05 Thread Ashley Moran
On 5 Sep 2008, at 15:58, Pat Maddox wrote: module Bank describe "A new account" do ... end end The RSpec codebase uses the second approach, which I personally prefer. Aha, that's good enough for me Right now I'm fully qualifying everything, which is too verbose for my liking Thanks

Re: [rspec-users] do I use mocking (vs fixtures) for methods that produce results based on non-trivial SQL queries

2008-09-05 Thread Ben Mabey
Scott Taylor wrote: > > On Sep 5, 2008, at 10:55 AM, Pat Maddox wrote: > >>> time. Just do the math: If one database test takes 0.2 sec (a >>> realistic >>> figure), then 5 will take 1 sec, at 1000 over 3 minutes, and at 2000 >>> over 6 >>> minutes. This is starting to get into "time for a >>> co

Re: [rspec-users] do I use mocking (vs fixtures) for methods that produce results based on non-trivial SQL queries

2008-09-05 Thread Scott Taylor
On Sep 5, 2008, at 10:55 AM, Pat Maddox wrote: time. Just do the math: If one database test takes 0.2 sec (a realistic figure), then 5 will take 1 sec, at 1000 over 3 minutes, and at 2000 over 6 minutes. This is starting to get into "time for a coffee/cigarette/ juggling what have you" br

Re: [rspec-users] Make classes in a module available to examples

2008-09-05 Thread Pat Maddox
On Fri, Sep 5, 2008 at 6:25 AM, Ashley Moran <[EMAIL PROTECTED]> wrote: > Hi > > Sorry if this is documented somewhere, I can't find it on rspec.info or > Google. > > Say I have this code (simple example based no the RSpec site): > module Bank >class Account > def balance >0 >

Re: [rspec-users] do I use mocking (vs fixtures) for methods that produce results based on non-trivial SQL queries

2008-09-05 Thread Pat Maddox
> time. Just do the math: If one database test takes 0.2 sec (a realistic > figure), then 5 will take 1 sec, at 1000 over 3 minutes, and at 2000 over 6 > minutes. This is starting to get into "time for a coffee/cigarette/juggling > what have you" breaks. So - either you end up very hyped up on c

Re: [rspec-users] do I use mocking (vs fixtures) for methods that produce results based on non-trivial SQL queries

2008-09-05 Thread Scott Taylor
On Sep 5, 2008, at 10:08 AM, Greg Hauptmann wrote: Hi, In cases where I have model methods that are generating data based on non-trivial SQL queries to a database (e.g. to pull together data required to plot an appropriate graph), does this really require a traditional fixture (i.e. pre-canned

Re: [rspec-users] do I use mocking (vs fixtures) for methods that produce results based on non-trivial SQL queries

2008-09-05 Thread Pat Maddox
On Fri, Sep 5, 2008 at 7:23 AM, Mark Wilden <[EMAIL PROTECTED]> wrote: > On Fri, Sep 5, 2008 at 7:08 AM, Greg Hauptmann > <[EMAIL PROTECTED]> wrote: >> >> Hi, >> >> In cases where I have model methods that are generating data based on >> non-trivial SQL queries to a database (e.g. to pull together

Re: [rspec-users] do I use mocking (vs fixtures) for methods that produce results based on non-trivial SQL queries

2008-09-05 Thread Mark Wilden
On Fri, Sep 5, 2008 at 7:08 AM, Greg Hauptmann < [EMAIL PROTECTED]> wrote: > Hi, > > In cases where I have model methods that are generating data based on > non-trivial SQL queries to a database (e.g. to pull together data > required to plot an appropriate graph), does this really require a > trad

[rspec-users] do I use mocking (vs fixtures) for methods that produce results based on non-trivial SQL queries

2008-09-05 Thread Greg Hauptmann
Hi, In cases where I have model methods that are generating data based on non-trivial SQL queries to a database (e.g. to pull together data required to plot an appropriate graph), does this really require a traditional fixture (i.e. pre-canned test data) as opposed to use of mocks? That is, the b

Re: [rspec-users] is there a way to create spec tests (including directories) for an existing set of models/controllers?>>

2008-09-05 Thread Greg Hauptmann
thanks Ben - this works nicely On Fri, Sep 5, 2008 at 4:18 PM, Ben Mabey <[EMAIL PROTECTED]> wrote: > Greg Hauptmann wrote: >> Hi, >> >> is there a way to create spec tests (including directories) for an >> existing set of models/controllers? (i.e. as opposed to the generate >> options that rspe

[rspec-users] Make classes in a module available to examples

2008-09-05 Thread Ashley Moran
Hi Sorry if this is documented somewhere, I can't find it on rspec.info or Google. Say I have this code (simple example based no the RSpec site): module Bank class Account def balance 0 end end end describe "A new account" do # what goes here? befor