[rspec-users] NullDb makes rake spec take (much) longer

2009-01-12 Thread Matt Wynne
Hi all, We did a spike last week to de-couple our view and controller tests from the database, using NullDb. It didn't go too well. I realise that this plugin isn't part of RSpec, but I thought others on this list might have experiences to share. Here's a summary of my colleague's

Re: [rspec-users] getting started - very much a beginner

2009-01-12 Thread James Byrne
Tom Cloyd wrote: The problem is that this assumes you are working with Rails, about which I know little and desire to know less. I get stuck, on that page, at the phrase... ==When you run script/generate cucumber == Huh? Is this something you do in Rails? Then there's this --

[rspec-users] Persisting Logins and Sessions across scenarios

2009-01-12 Thread James Byrne
I have an authentication filter on my application controller. I have the following feature statements: Scenario: I should be logged in to do any of this Given we have a user named myuser And the user named myuser logs in When they visit the entities page Then they should see

Re: [rspec-users] Persisting Logins and Sessions across scenarios

2009-01-12 Thread David Chelimsky
On Mon, Jan 12, 2009 at 10:45 AM, James Byrne li...@ruby-forum.com wrote: I have an authentication filter on my application controller. I have the following feature statements: Scenario: I should be logged in to do any of this Given we have a user named myuser And the user named

Re: [rspec-users] NullDb makes rake spec take (much) longer

2009-01-12 Thread Ben Mabey
On 1/12/09 7:09 AM, Matt Wynne wrote: Hi all, We did a spike last week to de-couple our view and controller tests from the database, using NullDb. It didn't go too well. I realise that this plugin isn't part of RSpec, but I thought others on this list might have experiences to share.

Re: [rspec-users] Persisting Logins and Sessions across scenarios

2009-01-12 Thread James Byrne
David Chelimsky wrote: Each scenario operates in a new session. I usually have a step that aggregates the login process: Given /^I am logged in as (.*)/ do |role| #create a user whose name and role are based on the role #log in that user end This lets me say: Given I am

Re: [rspec-users] Persisting Logins and Sessions across scenarios

2009-01-12 Thread aslak hellesoy
On Mon, Jan 12, 2009 at 6:21 PM, David Chelimsky dchelim...@gmail.comwrote: On Mon, Jan 12, 2009 at 10:45 AM, James Byrne li...@ruby-forum.com wrote: I have an authentication filter on my application controller. I have the following feature statements: Scenario: I should be logged in

Re: [rspec-users] Persisting Logins and Sessions across scenarios

2009-01-12 Thread James Byrne
Aslak Hellesøy wrote: On Mon, Jan 12, 2009 at 6:21 PM, David Chelimsky dchelim...@gmail.comwrote: Then they should see the entities page Then I should save the entity information successfully response.body.should =~ /Add a New Entity/m And coupling scenarios (or any kind of

Re: [rspec-users] Persisting Logins and Sessions across scenarios

2009-01-12 Thread Stephen Eley
On Mon, Jan 12, 2009 at 1:47 PM, James Byrne li...@ruby-forum.com wrote: At the start of every scenario, but is there no way of performing the actual log in once, place the session info into an instance variable and then use that rather than actually starting up a new session each and every

Re: [rspec-users] Persisting Logins and Sessions across scenarios

2009-01-12 Thread James Byrne
Stephen Eley wrote: On acceptance testing, I'd favor going through the actual session creation logic instead of mocking it, even if you don't put an explicit Given every time. Yeah, it's slower. But acceptance tests aren't _supposed_ to be fast; they're supposed to demonstrate real

Re: [rspec-users] NullDb makes rake spec take (much) longer

2009-01-12 Thread Matt Wynne
On 12 Jan 2009, at 17:36, Ben Mabey wrote: On 1/12/09 7:09 AM, Matt Wynne wrote: Hi all, We did a spike last week to de-couple our view and controller tests from the database, using NullDb. It didn't go too well. I realise that this plugin isn't part of RSpec, but I thought others on

Re: [rspec-users] NullDb makes rake spec take (much) longer

2009-01-12 Thread Ben Mabey
On 1/12/09 1:05 PM, Matt Wynne wrote: On 12 Jan 2009, at 17:36, Ben Mabey wrote: On 1/12/09 7:09 AM, Matt Wynne wrote: Hi all, We did a spike last week to de-couple our view and controller tests from the database, using NullDb. It didn't go too well. I realise that this plugin isn't part

[rspec-users] Help with regexp in matcher

2009-01-12 Thread James Byrne
This is giving me an error: When /?:(log|sign)?:(i|o)n success message/ do Then welcome message end To the effect that: /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': ./features/components/login/step_definitions/login_steps.rb:21: invalid regular

Re: [rspec-users] Help with regexp in matcher

2009-01-12 Thread Tim Glen
This is giving me an error: When /?:(log|sign)?:(i|o)n success message/ do Then welcome message end I could be wrong, but I believe you're looking for this instead? When /(?:log|sign)(?:i|o)n success message/ do hope that helps, timg ___

Re: [rspec-users] Help with regexp in matcher

2009-01-12 Thread Ben Mabey
On 1/12/09 2:50 PM, James Byrne wrote: This is giving me an error: When /?:(log|sign)?:(i|o)n success message/ do Then welcome message end The ?: needs to be inside your group if you don't want to capture it... so: When /(?:log|sign)(?:i|o)n success message/ do FWIW, I have found

Re: [rspec-users] Help with regexp in matcher

2009-01-12 Thread Stephen Eley
On Mon, Jan 12, 2009 at 4:50 PM, James Byrne li...@ruby-forum.com wrote: When /?:(log|sign)?:(i|o)n success message/ do Then welcome message end It's a syntax error on that first question mark, the one right after the slash. A ? in a regex signifies that whatever came just before it may

Re: [rspec-users] Who is using NullDB?

2009-01-12 Thread Ben Mabey
On 1/12/09 4:20 PM, Avdi Grimm wrote: I gather from some recent posts that some people are actually using NullDB in their projects. As the creator of NullDB, I'm pleased and a little surprised to hear this. Since NullDB is has received exactly zero attention from me since it's initial

Re: [rspec-users] Who is using NullDB?

2009-01-12 Thread Pat Maddox
On Mon, Jan 12, 2009 at 3:20 PM, Avdi Grimm a...@avdi.org wrote: I gather from some recent posts that some people are actually using NullDB in their projects. As the creator of NullDB, I'm pleased and a little surprised to hear this. Since NullDB is has received exactly zero attention from

Re: [rspec-users] Persisting Logins and Sessions across scenarios

2009-01-12 Thread Pat Maddox
On Mon, Jan 12, 2009 at 11:49 AM, James Byrne li...@ruby-forum.com wrote: Stephen Eley wrote: On acceptance testing, I'd favor going through the actual session creation logic instead of mocking it, even if you don't put an explicit Given every time. Yeah, it's slower. But acceptance tests