Re: [rspec-users] Confused - which is the correct Story API

2008-06-17 Thread Pat Maddox
> Thanks for any pointers here. Hey Jim, You've got the correct syntax for both styles. Pat ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Reusing story snippets

2008-06-17 Thread Jim Morris
Ok here is my sugar, put in spec_helper.rb require 'rubygems' require 'spec' require 'spec/story' # simulate before(:all) and after(:all) for stories class MyListener def set_before(&block) @before= block end def set_after(&block) @after= block end def method_missing sym, *arg

Re: [rspec-users] Reusing story snippets

2008-06-17 Thread Jim Morris
Yep thats exactly the case, an entire Story specific setup/teardown for the Given, When Language API Scenario setup is obviously done in the Given, although a way to clean up if the spec fails would be nice. The listener works fine for this, its just not a very intuitive way of setting things up.

Re: [rspec-users] Reusing story snippets

2008-06-17 Thread Ben Mabey
Jim Morris wrote: Hi, Not top posting (although I prefer it ;) Cool. Are you talking directly through ruby constructs or through a browser tool like selenium? I have a helper that makes posts and gets and deletes and puts directly to the server which is implements a mostly REST-ful AP

[rspec-users] Confused - which is the correct Story API

2008-06-17 Thread Jim Morris
Hi, I am confused (a normal state for me) about the State-Of-The-Art Story API to use. examples/calculator.rb has one syntax, the Blogs have another Syntax, so do the various tutorials. I realize that Stories are ongoing work, but it would be nice if there were something I could refer to to make

Re: [rspec-users] Reusing story snippets

2008-06-17 Thread Jim Morris
Hi, Not top posting (although I prefer it ;) > > Cool. Are you talking directly through ruby constructs or through a > browser tool like selenium? I have a helper that makes posts and gets and deletes and puts directly to the server which is implements a mostly REST-ful API and written in Java. I

Re: [rspec-users] Reusing story snippets

2008-06-17 Thread David Chelimsky
On Jun 17, 2008, at 10:41 AM, Ben Mabey wrote: David Chelimsky wrote: Reordered your posts so my comments make sense (we prefer to avoid top-posting - even though I sometimes violate that myself :) ). On Jun 16, 11:58 pm, Jim Morris <[EMAIL PROTECTED]> wrote: I'm not using Rails, I am doin

Re: [rspec-users] Reusing story snippets

2008-06-17 Thread Ben Mabey
David Chelimsky wrote: Reordered your posts so my comments make sense (we prefer to avoid top-posting - even though I sometimes violate that myself :) ). On Jun 16, 11:58 pm, Jim Morris <[EMAIL PROTECTED]> wrote: I'm not using Rails, I am doing end to end integration testing talking to

Re: [rspec-users] Reusing story snippets

2008-06-17 Thread David Chelimsky
Reordered your posts so my comments make sense (we prefer to avoid top-posting - even though I sometimes violate that myself :) ). > On Jun 16, 11:58 pm, Jim Morris <[EMAIL PROTECTED]> wrote: >> I'm not using Rails, I am doing end to end integration testing talking >> to the server via net/http, s

Re: [rspec-users] render_to_string confusing ControllerSpec

2008-06-17 Thread David Chelimsky
On Mon, Jun 16, 2008 at 10:23 PM, Andrew Selder <[EMAIL PROTECTED]> wrote: > David, > > Valid point about the method needing some refactoring. But another key rule > of refactoring is to have passing tests before refactoring. Catch 22 indeed. Are you familiar w/ Michael Feathers' book Working Effe

Re: [rspec-users] Reusing story snippets

2008-06-17 Thread Jim Morris
Ahh ok think I found it... In my test file at the start... class MyListener def method_missing sym, *args, &block # ignore all messages you don't care about end def story_started(title, narrative) puts "...Started story #{title}" end def story_ended(title, narrative) puts