Well, my original example was contrived but overly simple. When I read about
the "regex" support I immediately thought it would also support more complex
things something like this:
@Then("I can [view|examine|list] the new files(.*)")
(but not matching "I can delete the new files")
Or
@When("I see $number widget(s)* on the screen [to the left of|above] the
refresh button")
But I get it now. I misunderstood what the "regex" support meant. Thank you
all for the help. I got my simple prototype (driving a web app using JWebUnit)
working to my satisfaction, and so I'm building a much more complex (driving a
Flex app using a FunFx and lots of homebrew code) prototype.
Cheers,
Todd.
From: Paul Hammant [mailto:[email protected]]
Sent: Friday, January 28, 2011 8:15 PM
To: [email protected]
Subject: Re: [jbehave-user] regex examples, please
You can do exactly what you want like so:
@Then("I can view files $somethingExtraneous")
public thenICanViewFiles() {
// etc
}
$somethingExtraneous is the equiv of the real regex you wish for. Note that
'variables' mentioned in the annotation do not have to be used in the
applicable method.
- Paul