Re: [rspec-users] RSpec makes me want to write better code

2008-09-27 Thread Matt Wynne
On 26 Sep 2008, at 17:28, Mark Wilden wrote: On Fri, Sep 26, 2008 at 8:28 AM, Ashley Moran [EMAIL PROTECTED] wrote: One downside to STI is it forces you to leave NULL columns for attributes that don't exist in all models. This is also really bad for integrity. I think all of your

[rspec-users] Programmatically running specs

2008-09-27 Thread Daniel Lucraft
Hi all, does anyone have any tips or examples on how to run specs programmatically? I'd like to manually load some example groups, then perhaps reflect on their describes and its, and then execute them and get back a Ruby object which I can interrogate for the results. thanks Dan

[rspec-users] Running RSpec from within my Ruby application

2008-09-27 Thread Daniel Lucraft
Hi all (I tried to send this question to the list a few hours ago, but it seems to have not got through. If it did sorry for the duplication.) Does anyone have any tips or examples of how to run RSpec example groups programmatically from within a Ruby application? Essentially I would like to be

Re: [rspec-users] Running RSpec from within my Ruby application

2008-09-27 Thread Daniel Lucraft
Well, after some time fiddling, I've come up with this: require 'rubygems' # make sure nothing gets added to ruby's at_exit hook: $spec_runner_at_exit_hook_registered = true # load RSpec require 'spec' require 'spec/runner/formatter/base_formatter' # helper to find all defined

Re: [rspec-users] RSpec makes me want to write better code

2008-09-27 Thread Dan North
2008/9/26 David Chelimsky [EMAIL PROTECTED] On Fri, Sep 26, 2008 at 12:18 PM, Mark Wilden [EMAIL PROTECTED] wrote: On Fri, Sep 26, 2008 at 9:47 AM, Ashley Moran [EMAIL PROTECTED] wrote: To me, spec'ing attributes is a red flag. It is not always a bad thing or wrong, but it suggests that

Re: [rspec-users] RSpec makes me want to write better code

2008-09-27 Thread Mark Wilden
On Sat, Sep 27, 2008 at 11:26 AM, Dan North [EMAIL PROTECTED] wrote: It seems these conversations come up time and again because Rails overloads the idea of model. In a Rails app the model serves as both your domain model and your persistence strategy, because of the coupling inherent in the

[rspec-users] Why no rspec-rails gem?

2008-09-27 Thread Tim Harper
I was getting a little tired of adding 2 plugins every time I create a new rails project, so I just built an rspec-rails gemspec, and it works perfectly well. Does anybody know why there isn't a public rspec-rails gem? Tim ___ rspec-users

Re: [rspec-users] Why no rspec-rails gem?

2008-09-27 Thread Ben Mabey
Tim Harper wrote: I was getting a little tired of adding 2 plugins every time I create a new rails project, so I just built an rspec-rails gemspec, and it works perfectly well. Does anybody know why there isn't a public rspec-rails gem? Tim ___

Re: [rspec-users] Why no rspec-rails gem?

2008-09-27 Thread David Chelimsky
On Sat, Sep 27, 2008 at 3:11 PM, Ben Mabey [EMAIL PROTECTED] wrote: Tim Harper wrote: I was getting a little tired of adding 2 plugins every time I create a new rails project, so I just built an rspec-rails gemspec, and it works perfectly well. Does anybody know why there isn't a public

Re: [rspec-users] RSpec makes me want to write better code

2008-09-27 Thread David Chelimsky
On Sat, Sep 27, 2008 at 2:29 PM, Mark Wilden [EMAIL PROTECTED] wrote: On Sat, Sep 27, 2008 at 11:26 AM, Dan North [EMAIL PROTECTED] wrote: It seems these conversations come up time and again because Rails overloads the idea of model. In a Rails app the model serves as both your domain model

Re: [rspec-users] RSpec makes me want to write better code

2008-09-27 Thread Mark Wilden
On Sat, Sep 27, 2008 at 1:32 PM, David Chelimsky [EMAIL PROTECTED]wrote: On Sat, Sep 27, 2008 at 2:29 PM, Mark Wilden [EMAIL PROTECTED] wrote: I guess this makes me an AR pixie. :) I *think* Dan means underlying magic code when he uses the word pixie. Oh. Right. Never mind. :) ///ark

Re: [rspec-users] RSpec makes me want to write better code

2008-09-27 Thread aslak hellesoy
On Sat, Sep 27, 2008 at 10:32 PM, David Chelimsky [EMAIL PROTECTED] wrote: On Sat, Sep 27, 2008 at 2:29 PM, Mark Wilden [EMAIL PROTECTED] wrote: On Sat, Sep 27, 2008 at 11:26 AM, Dan North [EMAIL PROTECTED] wrote: It seems these conversations come up time and again because Rails overloads the

Re: [rspec-users] Running RSpec from within my Ruby application

2008-09-27 Thread Scott Taylor
On Sep 27, 2008, at 8:02 AM, Daniel Lucraft wrote: Hi all (I tried to send this question to the list a few hours ago, but it seems to have not got through. If it did sorry for the duplication.) Does anyone have any tips or examples of how to run RSpec example groups programmatically from

Re: [rspec-users] RSpec makes me want to write better code

2008-09-27 Thread Ashley Moran
On Sep 27, 2008, at 12:16 am, David Chelimsky wrote: This is really a deficiency of ActiveRecord migrations in my view. DataMapper, for example, offers auto-migrations. You just add a property to your model file and it takes care of the migration for you. Of course, the way it does this is to

Re: [rspec-users] RSpec makes me want to write better code

2008-09-27 Thread Ashley Moran
On Sep 27, 2008, at 9:17 am, Matt Wynne wrote: I wouldn't call this the 'rails way' particularly - I think it's more of a general OO design philosophy that says the database is just an implementation detail. I have gradually moved, over the years, from feeling like the database needed to

Re: [rspec-users] Why no rspec-rails gem?

2008-09-27 Thread Tim Harper
Hey Tim, I actually added a 'gem' task to the rspec-rails project a while ago.. It was soon deprecated in favor of using Hoe however. Either way though rspec-rails on github allows you to build the gem yourself using rake and install it locally. I think the reason for not making it an