Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
run guard cucumber features if (and only if) guard rspec passes
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Brandon Faloona  
View profile  
 More options Oct 30 2012, 9:32 pm
From: Brandon Faloona <bfalo...@gmail.com>
Date: Tue, 30 Oct 2012 18:32:15 -0700 (PDT)
Local: Tues, Oct 30 2012 9:32 pm
Subject: run guard cucumber features if (and only if) guard rspec passes

Greetings-

I have rspec and cucumber guards in my Guardfile but I'd like to run
cucumber features if (and only if) my rspec tests ALL pass. Is that
possible?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Kessler  
View profile  
 More options Oct 31 2012, 2:47 am
From: Michael Kessler <mi...@netzpiraten.ch>
Date: Wed, 31 Oct 2012 07:47:07 +0100
Local: Wed, Oct 31 2012 2:47 am
Subject: Re: run guard cucumber features if (and only if) guard rspec passes

Hi

It's not supported out of the box, but you can achieve it by using callbacks.

guard :rspec do
  …
  # Trigger all Cucumber features when all Specs passed
  callback(:all_end) do
    unless Guard.guards(:rspec).instance_variable_get('@last_failed')
      Guard.run_all({ :guard => Guard.guards(:cucumber) })
    end
  end
end

@thibaudgg: Would be nice to have an accessor for `@last_failed` :P

Michael

On 31.10.2012, at 02:32, Brandon Faloona <bfalo...@gmail.com> wrote:

  smime.p7s
5K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Thibaud Guillaume-Gentil  
View profile  
 More options Oct 31 2012, 3:34 am
From: Thibaud Guillaume-Gentil <thib...@thibaud.me>
Date: Wed, 31 Oct 2012 08:34:26 +0100
Local: Wed, Oct 31 2012 3:34 am
Subject: Re: run guard cucumber features if (and only if) guard rspec passes
Good point @netzpirat, I added an accessor for last_failed & failed_paths in guard-rspec release 2.1.1.

Thanks!

Thibaud

On Oct 31, 2012, at 07:47 , Michael Kessler <mi...@netzpiraten.ch> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jared Moody  
View profile  
 More options Nov 7 2012, 3:03 pm
From: Jared Moody <ja...@yourelevation.com>
Date: Wed, 7 Nov 2012 12:03:43 -0800 (PST)
Local: Wed, Nov 7 2012 3:03 pm
Subject: Re: run guard cucumber features if (and only if) guard rspec passes

Isn't the hook :run_all_end? I think this little snipped would be a good
candidate for a wiki page; since this is how autospec works, I was looking
for a way to make it the same.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rémy Coutable  
View profile  
 More options Nov 7 2012, 3:13 pm
From: Rémy Coutable <r...@rymai.me>
Date: Wed, 7 Nov 2012 21:13:08 +0100
Local: Wed, Nov 7 2012 3:13 pm
Subject: Re: run guard cucumber features if (and only if) guard rspec passes
Yep it's :run_all_end, good catch!

Feel free to create a Wiki page for that!

Rémy

On Nov 7, 2012, at 21:03 , Jared Moody <ja...@yourelevation.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jared Moody  
View profile  
 More options Nov 7 2012, 9:18 pm
From: Jared Moody <ja...@yourelevation.com>
Date: Wed, 7 Nov 2012 18:18:58 -0800 (PST)
Local: Wed, Nov 7 2012 9:18 pm
Subject: Re: run guard cucumber features if (and only if) guard rspec passes

I was thinking this should go on the guard-cucumber github wiki, but it
doesn't look like wiki pages are enabled.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jared Moody  
View profile  
 More options Nov 7 2012, 9:24 pm
From: Jared Moody <ja...@yourelevation.com>
Date: Wed, 7 Nov 2012 18:24:48 -0800 (PST)
Local: Wed, Nov 7 2012 9:24 pm
Subject: Re: run guard cucumber features if (and only if) guard rspec passes

er, maybe just I'm not a contributor


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rémy Coutable  
View profile  
 More options Apr 16, 3:36 pm
From: Rémy Coutable <r...@rymai.me>
Date: Tue, 16 Apr 2013 12:36:10 -0700 (PDT)
Local: Tues, Apr 16 2013 3:36 pm
Subject: Re: run guard cucumber features if (and only if) guard rspec passes

Hi,

Just wanted to let you know that there's actually a useful feature (not
documented in the README but in Rubydoc.info:
http://rubydoc.info/gems/guard/Guard/Group) in Guard that allows you to
halt Guard plugins execution inside a group if one of the plugins throws
:task_has_failed. Each Guard plugins has to implement this but luckily for
you guard-rspec does implement
it: https://github.com/guard/guard-rspec/blob/master/lib/guard/rspec.rb#L40

To take advantage of this feature, simple put your rspec and your cucumber
plugins in the same group and set the :halt_on_fail group option to true.

Like this:

group :specs, halt_on_fail: true do

  guard :rspec do
    watch(...)
  end

  guard :cucumber do
    watch(...)
  end

end

I think in your case, you'll have to set a "watch" that run all the
cucumber specs everytime (and it'll actually run only when the specs pass).

Hope that helps!

Regards,
Rémy


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »