#86 new
dwg

Descriptions containing the letters 'end' get mangled

Reported by dwg | 2009-04-18 22:23:04 UTC

I have a spec described as

it 'should extend ...'

Which gets changed to

'should ext}); ...'

By changing the following line

replace(/end(?= |\n|$)/gm, '});').

to

replace(/\send(?= |\n|$)/gm, '});').

fixes the problem.

Comments and changes to this ticket

  • dwg

    dwg 2009-04-19 12:21:02 UTC

    Update: the line should be

    replace(/(?:\s|^)end(?=\s|$)/gm, '});').

    Additionally, the line

    replace(/^(?: *)(before_each|after_each|before|after)(?= |\n|$)/gm, 'this.addHook("$1", function(){').

    assumes that indentation is spaces (I use tabs), should be

    replace(/^(?:\s*)(before_each|after_each|before|after)(?=\s|$)/gm, 'this.addHook("$1", function(){').

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Tiny, full-featured JavaScript BDD framework.

People watching this ticket

Pages