[rspec-users] Step matchers
pergesu at gmail.com
Sun Oct 14 23:53:32 EDT 2007
On 10/14/07, David Chelimsky <dchelimsky at gmail.com> wrote:
> On 10/14/07, Pat Maddox <pergesu at gmail.com> wrote:
> > Actually a parser for this would be quite simple
> Dead simple. It would also allow us to do away with methods like
> Given, When and Then, which some people have objected to (because of
> the capitalization), because the stories are no longer expressed
> directly in Ruby. Internally, the parser could use a StepFactory to do
> things like create_given, create_when, etc (or however we decide to
> name these).
Jay mentioned antlr. This parser is so simple though that I doubt we
would need/want that. There's not really any parsing at all in fact.
You just look at each line, figure out what token it is, and pass the
following string to a constructor. It should be like 60 lines of Ruby
code, and we don't have any external dependencies.
More information about the rspec-users