[rspec-users] Language configuration in cucumber

2008-09-26 Thread Juanma Cervera
I have just installed cucumber in a rails application following the instructions in the wiki http://github.com/aslakhellesoy/cucumber/wikis/ruby-on-rails How I have to specify the configuration option for using cucumber in spanish language? Is there a file cucumber.opts in some folder? or have I

Re: [rspec-users] Language configuration in cucumber

2008-09-26 Thread aslak hellesoy
On Fri, Sep 26, 2008 at 1:19 PM, Juanma Cervera [EMAIL PROTECTED] wrote: I have just installed cucumber in a rails application following the instructions in the wiki http://github.com/aslakhellesoy/cucumber/wikis/ruby-on-rails How I have to specify the configuration option for using cucumber

[rspec-users] BDD / cucumber thought - chaining 'Then' steps with Which

2008-09-26 Thread Matt Wynne
Going back to the debate about keeping state between steps, I found myself with the mild urge to be able to write this today: Given there is a user And the user has 20 friends Then I should see a thumbnail of each of the users's friends Which should be a link to the user profile page for that

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

2008-09-26 Thread Ashley Moran
On 25 Sep 2008, at 17:48, Mark Wilden wrote: Each controller action only calls one model method other than an initial find or new.. I didn't get that article (or, rather, that particular subarticle) at all. I kinda tuned out when I read, Polymorphic associations, however, are

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

2008-09-26 Thread Matt Wynne
On 26 Sep 2008, at 12:31, Ashley Moran wrote: On 25 Sep 2008, at 17:48, Mark Wilden wrote: Each controller action only calls one model method other than an initial find or new.. I didn't get that article[1] (or, rather, that particular subarticle) at all. I kinda tuned out when I read,

Re: [rspec-users] Conditionally turning some specs on and off depending on runtime platform

2008-09-26 Thread Wincent Colaiuta
El 26/9/2008, a las 13:30, Ashley Moran [EMAIL PROTECTED] escribió: On Sep 25, 2008, at 9:50 pm, Wincent Colaiuta wrote: The following trick, calling pending from inside the before block, effectively does what I want. But I'm wondering if I can count on this behaviour going forward? What do

Re: [rspec-users] Conditionally turning some specs on and off depending on runtime platform

2008-09-26 Thread David Chelimsky
On Thu, Sep 25, 2008 at 3:50 PM, Wincent Colaiuta [EMAIL PROTECTED] wrote: The following trick, calling pending from inside the before block, effectively does what I want. But I'm wondering if I can count on this behaviour going forward? What do you think? Pending is not going anywhere.

Re: [rspec-users] BDD / cucumber thought - chaining 'Then' steps with Which

2008-09-26 Thread Josh Chisholm
Stories without shared state feel clunky to me, because we would never speak that way. I also had a similar urge, don't know if it's a programmer urge: Given a user With the name 'josh' And the password 'sesame' ...so I don't end up with an explosion of steps for 'a user with x', 'a user with

Re: [rspec-users] BDD / cucumber thought - chaining 'Then' steps with Which

2008-09-26 Thread Matt Wynne
On 26 Sep 2008, at 13:33, David Chelimsky wrote: On Fri, Sep 26, 2008 at 6:30 AM, Matt Wynne [EMAIL PROTECTED] wrote: Going back to the debate about keeping state between steps, I found myself with the mild urge to be able to write this today: Given there is a user And the user has 20

Re: [rspec-users] Conditionally turning some specs on and off depending on runtime platform

2008-09-26 Thread Scott Taylor
On Sep 25, 2008, at 4:50 PM, Wincent Colaiuta wrote: Hi folks, Wondering what the best (that is, neatest and most supported) way to conditionally turn off some specs depending on the runtime platform. Background: some of my specs call out to some third-party tools that may or may not be

Re: [rspec-users] BDD / cucumber thought - chaining 'Then' steps with Which

2008-09-26 Thread Matt Wynne
On 26 Sep 2008, at 13:59, Josh Chisholm wrote: Stories without shared state feel clunky to me, because we would never speak that way. I also had a similar urge, don't know if it's a programmer urge: Given a user With the name 'josh' And the password 'sesame' ...so I don't end up with an

Re: [rspec-users] BDD / cucumber thought - chaining 'Then' steps with Which

2008-09-26 Thread David Chelimsky
On Fri, Sep 26, 2008 at 7:59 AM, Matt Wynne [EMAIL PROTECTED] wrote: One of the promises of using treetop is the ability to extend the grammar yourself to include keywords like Which. Wow. OK I need to check that out. I don't know how directly this is supported at this point - when I said

Re: [rspec-users] Conditionally turning some specs on and off depending on runtime platform

2008-09-26 Thread Wincent Colaiuta
El 26/9/2008, a las 14:59, David Chelimsky [EMAIL PROTECTED] escribió: On Thu, Sep 25, 2008 at 3:50 PM, Wincent Colaiuta [EMAIL PROTECTED] wrote: The following trick, calling pending from inside the before block, effectively does what I want. But I'm wondering if I can count on this

Re: [rspec-users] Conditionally turning some specs on and off depending on runtime platform

2008-09-26 Thread David Chelimsky
On Fri, Sep 26, 2008 at 8:42 AM, Wincent Colaiuta [EMAIL PROTECTED] wrote: El 26/9/2008, a las 14:59, David Chelimsky [EMAIL PROTECTED] escribió: On Thu, Sep 25, 2008 at 3:50 PM, Wincent Colaiuta [EMAIL PROTECTED] wrote: The following trick, calling pending from inside the before block,

Re: [rspec-users] Language configuration in cucumber

2008-09-26 Thread Juanma Cervera
Thanks Aslak. when I executed ruby script/generate cucumber, after installing the plugins, these are the folders and files that were created: features/steps features/steps/env.rb features/steps/common_webrat.rb lib/tasks lib/tasks/cucumber.rake script/cucumber.rake I think script/cucumber.rake

Re: [rspec-users] Language configuration in cucumber

2008-09-26 Thread David Chelimsky
On Fri, Sep 26, 2008 at 8:47 AM, Juanma Cervera [EMAIL PROTECTED] wrote: Thanks Aslak. when I executed ruby script/generate cucumber, after installing the plugins, these are the folders and files that were created: features/steps features/steps/env.rb features/steps/common_webrat.rb

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

2008-09-26 Thread Mark Wilden
On Fri, Sep 26, 2008 at 4:49 AM, Matt Wynne [EMAIL PROTECTED] wrote: Also why is the article so down on STI? What are the drawbacks? What do people use instead? I think the guy is really just down on inheritance itself, which is not an unusual nor even entirely unjustified attitude. Ruby has

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

2008-09-26 Thread Mark Wilden
On Fri, Sep 26, 2008 at 4:31 AM, Ashley Moran [EMAIL PROTECTED] wrote: Is a better rule each controller action should contain no more than two branches? (But then, I try to apply that to all methods, and even then, I try to push conditional code as far down as possible.) On an OOP mailing

Re: [rspec-users] Conditionally turning some specs on and off depending on runtime platform

2008-09-26 Thread Mark Wilden
On Fri, Sep 26, 2008 at 5:13 AM, Wincent Colaiuta [EMAIL PROTECTED] wrote: No, it's actually a case of having a bunch of Java junk installed on my local system which I can use to do extended testing of things like feed validity on this machine, while on the server I don't have (and can't

Re: [rspec-users] Conditionally turning some specs on and off depending on runtime platform

2008-09-26 Thread Wincent Colaiuta
El 26/9/2008, a las 16:16, David Chelimsky [EMAIL PROTECTED] escribió: On Fri, Sep 26, 2008 at 8:42 AM, Wincent Colaiuta [EMAIL PROTECTED] wrote: El 26/9/2008, a las 14:59, David Chelimsky [EMAIL PROTECTED] escribió: On Thu, Sep 25, 2008 at 3:50 PM, Wincent Colaiuta [EMAIL PROTECTED]

Re: [rspec-users] Conditionally turning some specs on and off depending on runtime platform

2008-09-26 Thread Scott Taylor
On Sep 26, 2008, at 10:31 AM, Wincent Colaiuta wrote: El 26/9/2008, a las 16:16, David Chelimsky [EMAIL PROTECTED] escribió: On Fri, Sep 26, 2008 at 8:42 AM, Wincent Colaiuta [EMAIL PROTECTED] wrote: El 26/9/2008, a las 14:59, David Chelimsky [EMAIL PROTECTED] escribió: On Thu, Sep 25,

Re: [rspec-users] BDD / cucumber thought - chaining 'Then' steps with Which

2008-09-26 Thread Jonathan Linowes
On Sep 26, 2008, at 9:06 AM, Matt Wynne wrote: FWIW, I think it's rather nice. We went through a fad of using @it for a while, and now we have a stuff[] hash. Both similar ideas - there must be something in this. I'm doing the same thing. I had @current_project, @current_page etc (

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

2008-09-26 Thread Ashley Moran
On 26 Sep 2008, at 12:49, Matt Wynne wrote: Would you mind elaborating on why you don't like these? I'm pretty new to rails (but not programming generally) and rather naive about such things! It's quite hard to explain briefly, but basically it makes the predicate (interpretation of the

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

2008-09-26 Thread Ashley Moran
On 26 Sep 2008, at 15:16, Mark Wilden wrote: Also why is the article so down on STI? What are the drawbacks? What do people use instead? 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

Re: [rspec-users] Language configuration in cucumber

2008-09-26 Thread aslak hellesoy
On Fri, Sep 26, 2008 at 3:54 PM, David Chelimsky [EMAIL PROTECTED] wrote: On Fri, Sep 26, 2008 at 8:47 AM, Juanma Cervera [EMAIL PROTECTED] wrote: Thanks Aslak. when I executed ruby script/generate cucumber, after installing the plugins, these are the folders and files that were created:

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

2008-09-26 Thread Mark Wilden
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 comments make sense, but I did just want to call out

[rspec-users] RSpec, Rails, ObjectDaddy and transactions

2008-09-26 Thread Tim Glen
hey all, I've started playing around with object daddy and have a question? How do I ensure that anything created during a spec example gets rolled back before the next one? Without that ability, it starts messing with models that have unique columns on successive runs of my specs. Oh,

Re: [rspec-users] RSpec, Rails, ObjectDaddy and transactions

2008-09-26 Thread Scott Taylor
On Sep 26, 2008, at 12:38 PM, Tim Glen wrote: hey all, I've started playing around with object daddy and have a question? How do I ensure that anything created during a spec example gets rolled back before the next one? Without that ability, it starts messing with models that have

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

2008-09-26 Thread Ashley Moran
On 26 Sep 2008, at 17:28, Mark Wilden wrote: I think all of your comments make sense, but I did just want to call out that the Rails way is not typically concerned with this sort of integrity at the database level. It's handled in the model. Ah ok, I wasn't sure if your comment was

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

2008-09-26 Thread Mark Wilden
On Fri, Sep 26, 2008 at 9:47 AM, Ashley Moran [EMAIL PROTECTED] wrote: (be sure to spec what attributes your classes have if you're scared of pollution!) As part of the TDD process, I spec all attributes, but this doesn't seem universal. Is this a misconception? Do people actually make sure

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

2008-09-26 Thread Scott Taylor
On Sep 26, 2008, at 1:18 PM, Mark Wilden wrote: On Fri, Sep 26, 2008 at 9:47 AM, Ashley Moran [EMAIL PROTECTED] wrote: (be sure to spec what attributes your classes have if you're scared of pollution!) As part of the TDD process, I spec all attributes, but this doesn't seem universal.

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

2008-09-26 Thread Mark Wilden
On Fri, Sep 26, 2008 at 10:24 AM, Scott Taylor [EMAIL PROTECTED] wrote: I usually end up doing something like this: columns = [:email, :message] columns.each do |column| it should have a reader and writer for the column #{column} do @invite.should respond_to(column)

[rspec-users] rake spec defaults to devel env

2008-09-26 Thread Tero Tilus
I was experiencing the weirdest behavior (rake spec running fine without a test database) the other day. Turned out that actually rake spec was (and has been for heavens know how long for me) running in development environment. However script/spec runs in test environment just as I expect it to

Re: [rspec-users] RSpec, Rails, ObjectDaddy and transactions

2008-09-26 Thread Tim Glen
Oh, and I do have this line in my spec_helper: config.use_transactional_fixtures = true I assume that only does anything to fixtures, specifically No. That tells rspec/ test::unit to start a transaction at the start of every test case, and issue a rollback when it's over. That + a

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

2008-09-26 Thread Pat Maddox
Mark Wilden [EMAIL PROTECTED] writes: On Fri, Sep 26, 2008 at 4:49 AM, Matt Wynne span dir=ltrmailto:[EMAIL PROTECTED]/span wrote: Also why is the article so down on STI? What are the drawbacks? What do people use instead?I think the guy is really just down on inheritance itself, which is

Re: [rspec-users] DRY up story

2008-09-26 Thread Michael Latta
Thanks for the clarrification of your intent for the comment. After reading the linked threads I have the following questions/comments: 1) All the responses to sharing story content get use ruby as the response. 2( I understand you appear to find this adequate. I do not. 3) Should I open

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

2008-09-26 Thread Mark Wilden
On Fri, Sep 26, 2008 at 11:46 AM, Pat Maddox [EMAIL PROTECTED] wrote: Mark Wilden [EMAIL PROTECTED] writes: Task class and an Appointment subclass. An Appointment (in this context) is simply a Task that can only be performed on one day. Otherwise it#39;s exactly like a Task (again, in

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

2008-09-26 Thread Ashley Moran
On Sep 26, 2008, at 6:18 pm, Mark Wilden wrote: As part of the TDD process, I spec all attributes, but this doesn't seem universal. Is this a misconception? Do people actually make sure that all columns exist and can be written to and read from? What I meant by this was that say you have

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

2008-09-26 Thread David Chelimsky
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: (be sure to spec what attributes your classes have if you're scared of pollution!) As part of the TDD process, I spec all attributes, but this

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

2008-09-26 Thread Mark Wilden
On Fri, Sep 26, 2008 at 3:10 PM, David Chelimsky [EMAIL PROTECTED]wrote: Now sometimes there will be some up-front modeling discussions and you may have a sense that a model needs a specific set of fields just because that's what the customer says. In those cases, I'd recommend trying to

Re: [rspec-users] DRY up story

2008-09-26 Thread David Chelimsky
On Fri, Sep 26, 2008 at 1:48 PM, Michael Latta [EMAIL PROTECTED] wrote: Thanks for the clarrification of your intent for the comment. After reading the linked threads I have the following questions/comments: 1) All the responses to sharing story content get use ruby as the response. 2( I

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

2008-09-26 Thread David Chelimsky
On Fri, Sep 26, 2008 at 5:38 PM, Mark Wilden [EMAIL PROTECTED] wrote: On Fri, Sep 26, 2008 at 3:10 PM, David Chelimsky [EMAIL PROTECTED] wrote: Now sometimes there will be some up-front modeling discussions and you may have a sense that a model needs a specific set of fields just because

Re: [rspec-users] rake spec defaults to devel env

2008-09-26 Thread David Chelimsky
On Fri, Sep 26, 2008 at 12:36 PM, Tero Tilus [EMAIL PROTECTED] wrote: I was experiencing the weirdest behavior (rake spec running fine without a test database) the other day. Turned out that actually rake spec was (and has been for heavens know how long for me) running in development

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

2008-09-26 Thread Mark Wilden
On Fri, Sep 26, 2008 at 4:16 PM, David Chelimsky [EMAIL PROTECTED]wrote: DataMapper, for example, offers auto-migrations. You just add a property to your model file and it takes care of the migration for you. The relationship between schema and models in Rails is weird. The basic source of

Re: [rspec-users] RSpec, Rails, ObjectDaddy and transactions

2008-09-26 Thread David Chelimsky
On Fri, Sep 26, 2008 at 1:42 PM, Mark Wilden [EMAIL PROTECTED] wrote: On Fri, Sep 26, 2008 at 9:49 AM, Scott Taylor [EMAIL PROTECTED] wrote: On Sep 26, 2008, at 12:38 PM, Tim Glen wrote: Oh, and I do have this line in my spec_helper: config.use_transactional_fixtures = true I assume that

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

2008-09-26 Thread David Chelimsky
On Fri, Sep 26, 2008 at 6:47 PM, Mark Wilden [EMAIL PROTECTED] wrote: On Fri, Sep 26, 2008 at 4:16 PM, David Chelimsky [EMAIL PROTECTED] wrote: DataMapper, for example, offers auto-migrations. You just add a property to your model file and it takes care of the migration for you. The

Re: [rspec-users] DRY up story

2008-09-26 Thread Michael Latta
Using a macros directory rather than explicit dependencies (as is now true for steps) is fine. Unless you have a ton of macros it should not be too bad performance wise. And, it prevents duplicate steps from being used in different parts of a large spec unknowingly. The most likely use

Re: [rspec-users] rake spec defaults to devel env

2008-09-26 Thread Jonathan Linowes
On Sep 26, 2008, at 1:36 PM, Tero Tilus wrote: I was experiencing the weirdest behavior (rake spec running fine without a test database) the other day. Turned out that actually rake spec was (and has been for heavens know how long for me) running in development environment. However

Re: [rspec-users] DRY up story

2008-09-26 Thread Michael Latta
Ticket created http://rspec.lighthouseapp.com/projects/16211-cucumber/tickets/20-ability-to-write-steps-in-scenario-language Michael On Sep 26, 2008, at 5:20 PM, Michael Latta wrote: Using a macros directory rather than explicit dependencies (as is now true for steps) is fine. Unless you