Wrong story step running

Hi

I have three steps like this:

Given ‘a user called “$name” of type $user_type and status $user_state
in
organisation “$organisation_name”’ do |name, user_type, user_state,
organisation_name|
$runs ||= 1
puts “MOO #{$runs}”
$runs += 1
# …
end

Given ‘a user called “$name” with username “$username” of type
$user_type
and status $user_state in organisation “$organisation_name”’ do |name,
username, user_type, user_state, organisation_name|
# …
end

Given ‘a user called “$name” with secondary email “$secondary_email”
of
type $user_type and status $user_state in organisation
“$organisation_name”’
do |name, secondary_email, user_type, user_state, organisation_name|
# …
end

When I run a story containing these step calls:

And a user called "Mr Kameron Friesen" of type END_USER and status

APPROVED in organisation “My Infant School”
And a user called “Mr Adam Kameron” of type END_USER and status
APPROVED
in organisation “My Infant School”
And a user called “Mr Matching Username” with username "
[email protected]" of type END_USER and status APPROVED
in
organisation “My Infant School”
And a user called “Mrs Matching SecondaryEmail” with secondary email
"
[email protected]" of type END_USER and status APPROVED in
organisation “My Infant School”
And a user called “Miss NotMe Kovacek” of type END_USER and status
APPROVED in organisation “My Infant School”
And a user called “Mr No Match” of type END_USER and status APPROVED
in
organisation “Kameron’s School Should Not Match”

It always runs the body of the FIRST step, and not the ones that allow
passing a username or email. I know this because of the debugging
output I
left in the step above.

Anyone got an idea why this is happening? I’m gonna have to work around
it
for now, if I can figure out how.

Thanks
Ashley

Found this: if I change the other steps to

And a user called “Mr Matching Username” with username "
[email protected]" of typex END_USER and status APPROVED
in
organisation “My Infant School”

And a user called "Mrs Matching SecondaryEmail" with secondary email 

"
[email protected]" of typex END_USER and status APPROVED in
organisation “My Infant School”

then the “typex” makes it work again. Is story runner having trouble
matching stories when they are of the following pattern?
A + B
A + X + B
A + Y + B

Ashley

On 28/03/2008, Ashley M. [email protected] wrote:

Is story runner having trouble matching stories when they are of the
following pattern?
A + B
A + X + B
A + Y + B

Came across this again, it also causes problems when the steps are of
the
form
A
A + X

However, I found a (slightly better) workaround, which is to put the
most
specific steps first.

I filed a ticket here:
http://rspec.lighthouseapp.com/projects/5645/tickets/353-story-runner-step-matches-are-order-dependent

Ashley