Forum: RSpec RSpec, TestUnit, Cucumber and Autotest

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
171ea139761951336b844e708d1547ab?d=identicon&s=25 James Byrne (byrnejb)
on 2008-11-19 22:09
OS=CentOS-5.2
Ruby=1.8.6
Rails=2.2.1_RC
Gems all up to date

I have been experimenting with autotest and I have a few questions.

1. given export AUTOFEATURES=TRUE if ./test exists (with tests) then
these tests are run and the features are not.  Is this intended
behaviour?

2. given require 'autotest/redgreen' in .autotest if /test tests are run
then all I get colourized is a line of '======' but if /test is removed
and features run then the Failed message and the backtrace are
colourized.  Is this intentional as well?
C694a032be7518a0d704318895f8fe1d?d=identicon&s=25 Ben Mabey (mabes)
on 2008-11-19 22:14
(Received via mailing list)
James Byrne wrote:
>
>
Try doing TRUE in all lowercase.

-Ben
171ea139761951336b844e708d1547ab?d=identicon&s=25 James Byrne (byrnejb)
on 2008-11-19 22:33
Ben Mabey wrote:
> James Byrne wrote:
>>
>>
> Try doing TRUE in all lowercase.
>
> -Ben

$ set
AUTOFEATURE=true
BASH=/bin/bash
...
171ea139761951336b844e708d1547ab?d=identicon&s=25 James Byrne (byrnejb)
on 2008-11-20 16:57
James Byrne wrote:
> OS=CentOS-5.2
> Ruby=1.8.6
> Rails=2.2.1_RC
> Gems all up to date
>
> I have been experimenting with autotest and I have a few questions.
>
> 1. given: export AUTOFEATURES=true, if ./test exists (with tests) then
> these tests are run and the features are not.  Is this intended
> behaviour?
>

I have investigated further and the situation is this.  If all the
unit/functional tests under ~/test pass then, and only then, cucumber
feature tests are run.  If any unit/functional tests fail then cucumber
is not invoked.  It is not immediately clear to me whether this
behaviour is intended or not.  Can someone provide the answer?
C694a032be7518a0d704318895f8fe1d?d=identicon&s=25 Ben Mabey (mabes)
on 2008-11-20 17:56
(Received via mailing list)
James Byrne wrote:
>> these tests are run and the features are not.  Is this intended
>> behaviour?
>>
>>
>
> I have investigated further and the situation is this.  If all the
> unit/functional tests under ~/test pass then, and only then, cucumber
> feature tests are run.  If any unit/functional tests fail then cucumber
> is not invoked.  It is not immediately clear to me whether this
> behaviour is intended or not.  Can someone provide the answer?
>

Ahh... I didn't notice that you said you were using TestUnit.  Sorry
about not catching on sooner....  The cucumber autotest integration was
developed with autospec and rspec in mind.  I wouldn't be surprised if
it never was tested with testunit so it might have some rough edges.
Peter Jaros, the one who wrote the plugin, explained  how the plugin is
suppose to work/behave in the wiki:
http://github.com/aslakhellesoy/cucumber/wikis/aut...
(under 'What does it do?')

After reading the wiki I think what you are seeing is the expected
behaviour.  I don't think it is suppose to run the features until all
your tests are passing.

-Ben
D069ac0170dc6c93bad77734258fadae?d=identicon&s=25 Peter Jaros (Guest)
on 2008-11-20 19:29
(Received via mailing list)
On Thu, Nov 20, 2008 at 11:55 AM, Ben Mabey <ben@benmabey.com> wrote:

> James Byrne wrote:
>
>> It is not immediately clear to me whether this behaviour is
>> intended or not.  Can someone provide the answer?
>>
>
> After reading the wiki I think what you are seeing is the expected
> behaviour.  I don't think it is suppose to run the features until all your
> tests are passing.

Yes, that's the intended behavior.  According to that workflow, if
you've got unit tests failing, that's what you should be working on.

In RSpec, if you have failing examples which you don't actually want
to deal with yet, you can make them pending, and Autotest will ignore
the fact that they're not working.  I don't think Test::Unit provides
an equivalent feature, though.

Peter
171ea139761951336b844e708d1547ab?d=identicon&s=25 James Byrne (byrnejb)
on 2008-11-20 19:52
Peter Jaros wrote:

> In RSpec, if you have failing examples which you don't actually want
> to deal with yet, you can make them pending, and Autotest will ignore
> the fact that they're not working.  I don't think Test::Unit provides
> an equivalent feature, though.
>
> Peter

Yes, and no.  You can emulate a pending test by creating an empty
method:


  def test_should_show_me
    #TODO Pending
  end



As you imply, this will not show in the test run output.  It does show
up with the rake notes task though:

$ rake notes
(in ~/Software/Development/Projects/proforma.git)
test/functional/clients_controller_test.rb:
  * [ 33] [TODO] Pending
This topic is locked and can not be replied to.