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:
> 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:
>> 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?
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.
On Tuesday, October 30, 2012 11:47:13 PM UTC-7, netzpirat wrote:
> 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 <bfal...@gmail.com <javascript:>> > wrote:
> > 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?
> 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.
> On Tuesday, October 30, 2012 11:47:13 PM UTC-7, netzpirat wrote:
> 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 <bfal...@gmail.com> wrote:
> > 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?
On Wednesday, November 7, 2012 12:13:13 PM UTC-8, Rémy Coutable wrote:
> 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<javascript:>> > wrote:
> > 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.
> > On Tuesday, October 30, 2012 11:47:13 PM UTC-7, netzpirat wrote: > > 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 <bfal...@gmail.com> wrote:
> > > 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?
On Wednesday, November 7, 2012 6:18:58 PM UTC-8, Jared Moody wrote:
> I was thinking this should go on the guard-cucumber github wiki, but it > doesn't look like wiki pages are enabled.
> On Wednesday, November 7, 2012 12:13:13 PM UTC-8, Rémy Coutable wrote:
>> 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:
>> > 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.
>> > On Tuesday, October 30, 2012 11:47:13 PM UTC-7, netzpirat wrote: >> > 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 <bfal...@gmail.com> wrote:
>> > > 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?
On Thursday, November 8, 2012 3:24:48 AM UTC+1, Jared Moody wrote:
> er, maybe just I'm not a contributor
> On Wednesday, November 7, 2012 6:18:58 PM UTC-8, Jared Moody wrote:
>> I was thinking this should go on the guard-cucumber github wiki, but it >> doesn't look like wiki pages are enabled.
>> On Wednesday, November 7, 2012 12:13:13 PM UTC-8, Rémy Coutable wrote:
>>> 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:
>>> > 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.
>>> > On Tuesday, October 30, 2012 11:47:13 PM UTC-7, netzpirat wrote: >>> > 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 <bfal...@gmail.com> wrote:
>>> > > 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?