Can execution terminate after a scenario failure?

6 views
Skip to first unread message

tusar

unread,
Jun 4, 2010, 7:02:36 AM6/4/10
to Cukes
Hi,

While running a cucumber script having several scenarios, it tries to
execute all the scenario even though some of the scenario gets failed.
I wish the execution to terminate if one scenario is failed. Is it
possible?

Regards
Tusar

aslak hellesoy

unread,
Jun 4, 2010, 7:45:01 AM6/4/10
to cu...@googlegroups.com

Haven't tried it, but this might work:

After do |scenario|
Cucumber.wants_to_quit = true if scenario.failed?
end

Aslak

> Regards
> Tusar
>
> --
> You received this message because you are subscribed to the Google Groups "Cukes" group.
> To post to this group, send email to cu...@googlegroups.com.
> To unsubscribe from this group, send email to cukes+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/cukes?hl=en.
>
>

tusar

unread,
Jun 8, 2010, 12:55:22 AM6/8/10
to Cukes
Thanks, it works fine.

Regards
tusar

On Jun 4, 4:45 pm, aslak hellesoy <aslak.helle...@gmail.com> wrote:
> > For more options, visit this group athttp://groups.google.com/group/cukes?hl=en.- Hide quoted text -
>
> - Show quoted text -

beaufabry

unread,
Jun 8, 2010, 4:31:00 AM6/8/10
to Cukes
It would be like christmas came early if this was added as a command
line option to the executable

Beau

On Jun 8, 2:55 pm, tusar <nayaktu...@gmail.com> wrote:
> Thanks, it works fine.
>
> Regards
> tusarif
> > > For more options, visit this group athttp://groups.google.com/group/cukes?hl=en.-Hide quoted text -

Matt Wynne

unread,
Jun 8, 2010, 10:15:58 AM6/8/10
to cu...@googlegroups.com
Please raise a ticket on lighthouse for this, preferably with an imaginative suggestion for the name of the command-line flag.

aslak hellesoy

unread,
Jun 8, 2010, 11:16:50 AM6/8/10
to cu...@googlegroups.com
On Tue, Jun 8, 2010 at 10:15 AM, Matt Wynne <ma...@mattwynne.net> wrote:
> Please raise a ticket on lighthouse for this, preferably with an imaginative suggestion for the name of the command-line flag.
>

--early-xmas maybe?

Rick DeNatale

unread,
Jun 8, 2010, 11:32:34 AM6/8/10
to cu...@googlegroups.com
On Tue, Jun 8, 2010 at 11:16 AM, aslak hellesoy
<aslak.h...@gmail.com> wrote:
> On Tue, Jun 8, 2010 at 10:15 AM, Matt Wynne <ma...@mattwynne.net> wrote:
>> Please raise a ticket on lighthouse for this, preferably with an imaginative suggestion for the name of the command-line flag.
>>
>
> --early-xmas maybe?
>

--say-uncle

or more seriously

--quick-quit -Q

It would be nice to have something like this for RSpec as well. Got
your ears on DC?


--
Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Github: http://github.com/rubyredrick
Twitter: @RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale

David Chelimsky

unread,
Jun 8, 2010, 11:38:39 AM6/8/10
to cu...@googlegroups.com

On Jun 8, 2010, at 11:32 AM, Rick DeNatale wrote:

> On Tue, Jun 8, 2010 at 11:16 AM, aslak hellesoy
> <aslak.h...@gmail.com> wrote:
>> On Tue, Jun 8, 2010 at 10:15 AM, Matt Wynne <ma...@mattwynne.net> wrote:
>>> Please raise a ticket on lighthouse for this, preferably with an imaginative suggestion for the name of the command-line flag.
>>>
>>
>> --early-xmas maybe?
>>
>
> --say-uncle
>
> or more seriously
>
> --quick-quit -Q
>
> It would be nice to have something like this for RSpec as well. Got
> your ears on DC?

No - but http://github.com/dchelimsky/rspec-core/issues does :)

David Chelimsky

unread,
Jun 8, 2010, 11:41:46 AM6/8/10
to cu...@googlegroups.com
On Tue, Jun 8, 2010 at 11:38 AM, David Chelimsky <dchel...@gmail.com> wrote:
>
> On Jun 8, 2010, at 11:32 AM, Rick DeNatale wrote:
>
>> On Tue, Jun 8, 2010 at 11:16 AM, aslak hellesoy
>> <aslak.h...@gmail.com> wrote:
>>> On Tue, Jun 8, 2010 at 10:15 AM, Matt Wynne <ma...@mattwynne.net> wrote:
>>>> Please raise a ticket on lighthouse for this, preferably with an imaginative suggestion for the name of the command-line flag.
>>>>
>>>
>>> --early-xmas maybe?
>>>
>>
>> --say-uncle
>>
>> or more seriously
>>
>> --quick-quit -Q
>>
>> It would be nice to have something like this for RSpec as well.  Got
>> your ears on DC?
>
> No - but http://github.com/dchelimsky/rspec-core/issues does :)

D'oh - strike that, try this instead:

http://github.com/rspec/rspec-core/issues

Matt Wynne

unread,
Jun 8, 2010, 12:37:19 PM6/8/10
to cu...@googlegroups.com

On 8 Jun 2010, at 16:32, Rick DeNatale wrote:

> On Tue, Jun 8, 2010 at 11:16 AM, aslak hellesoy
> <aslak.h...@gmail.com> wrote:
>> On Tue, Jun 8, 2010 at 10:15 AM, Matt Wynne <ma...@mattwynne.net> wrote:
>>> Please raise a ticket on lighthouse for this, preferably with an imaginative suggestion for the name of the command-line flag.
>>>
>>
>> --early-xmas maybe?
>>
>
> --say-uncle
>
> or more seriously
>
> --quick-quit -Q

--boom -B

>
> It would be nice to have something like this for RSpec as well. Got
> your ears on DC?
>
>
> --
> Rick DeNatale
>
> Blog: http://talklikeaduck.denhaven2.com/
> Github: http://github.com/rubyredrick
> Twitter: @RickDeNatale
> WWR: http://www.workingwithrails.com/person/9021-rick-denatale
> LinkedIn: http://www.linkedin.com/in/rickdenatale
>

Rick DeNatale

unread,
Jun 8, 2010, 12:45:39 PM6/8/10
to cu...@googlegroups.com
On Tue, Jun 8, 2010 at 10:15 AM, Matt Wynne <ma...@mattwynne.net> wrote:
> Please raise a ticket on lighthouse for this, preferably with an imaginative suggestion for the name of the command-line flag.
>
> On 8 Jun 2010, at 09:31, beaufabry wrote:
>
>> It would be like christmas came early if this was added as a command
>> line option to the executable

>>> On Jun 4, 4:45 pm, aslak hellesoy <aslak.helle...@gmail.com> wrote:

>>>
>>>> Haven't tried it, but this might work:
>>>
>>>> After do |scenario|
>>>>   Cucumber.wants_to_quit = true if scenario.failed?
>>>> end

In the interim, I just added this to features/env.rb in one of my projects:

After do | scenario|
if ENV['qqcuke']


Cucumber.wants_to_quit = true if scenario.failed?
end

end

Then I can do something like

qqcuke=true rake cucumber


or any other way of running cuke.

Rick DeNatale

unread,
Jun 8, 2010, 12:51:46 PM6/8/10
to cu...@googlegroups.com
On Tue, Jun 8, 2010 at 11:41 AM, David Chelimsky <dchel...@gmail.com> wrote:

> D'oh - strike that, try this instead:
>
> http://github.com/rspec/rspec-core/issues

Okay, I created the issue.

I'd write a patch if I knew what to call the option. <G>

aslak hellesoy

unread,
Jun 8, 2010, 3:44:29 PM6/8/10
to cu...@googlegroups.com
On Tue, Jun 8, 2010 at 12:51 PM, Rick DeNatale <rick.d...@gmail.com> wrote:
> On Tue, Jun 8, 2010 at 11:41 AM, David Chelimsky <dchel...@gmail.com> wrote:
>
>> D'oh - strike that, try this instead:
>>
>> http://github.com/rspec/rspec-core/issues
>
> Okay, I created the issue.
>
> I'd write a patch if I knew what to call the option. <G>
>

Call it --hysteric. No 1-letter alias needed.

Reply all
Reply to author
Forward
0 new messages