[rspec-users] Variance in behaviour: rake features vs. autotest

James Byrne lists at ruby-forum.com
Thu Nov 27 12:39:26 EST 2008

James Byrne wrote:

> The error is that there exists no entity with id=1.  Ideas?

I have resolved all of the test result differences between running 
cucumber features -r features, rake features, and autotest.  These were 
dependent on whether testunit tests and their associated fixtures were 
invoked immediately prior to cucumber or not.

The fix to the last failing test was to eliminate the literal id=1 in 
the view test and use this construct instead:

Given /I am on the edit entity page/ do
  @party = Entity.first
  visits "/entities/#{@party.id}/edit"

Now, I still have a number of issues with respect to configuring 
autotest to work with cucumber.  If I have nothing in my cucumber.yml 
file then I see this:

script/cucumber features --format progress --format autotest --out 

If I change cucumber.yml, while autotest is running, to this:

autotest: features -r features

Then I see this:

script/cucumber --profile autotest --format autotest --out 
/tmp/autotest-cucumber.7817.1 -s 'No locations should exist' -s 'Test if 
Fixtures are loaded first' -s 'Record Entity basic identification 
information' -s 'The "common name" attribute should be normalized before 
saving' -s 'Delete entity' -s 'Attempt to ADD a VALID entity via a web 
form' -s 'Attempt to ADD an EMPTY entity via a web form' -s 'Attempt to 
ADD an UNNAMED entity via a web form' -s 'The common name should display 
with initial capitals'
Feature: Identify and record the location of parties to transactions

followed by a complete rerun of the entire test suite including 
testunit.  However, I do not see this:


at the top of the test run before displaying the steps and tracebacks on 
the console. Which, I admit, does not say much but I would like to know 
how to get it nonetheless.  Adding --format progress by itself seems to 
just provide a string of dots ............................ etc.

I would also like to know how to see both the progress bar and the 
pretty format console display of the tests.  If I add --format pretty 
after --format progress then the dots are interspersed with the step 
results.  Like so:

.    And I am on the edit entity page 
# features/entities/step_definitions/entity_steps.rb:125
.    When I fill in "Common Name" with "  ANYThing   WronG wITh tHiS? " 
# features/step_definitions/webrat_steps.rb:12
.    And I commit the update

Note the leading '.' which prefaces each passing line.

Finally, my custom notice command for autotest seems not to get called 
when running cucumber although it works perfectly well with the TestUnit 

  Autotest.add_hook :red do |at|
    notify ERROR_STOCK_ICON, "Failing Tests", "#{at.files_to_test.size} 
tests failed."

Suggestions welcome.

Posted via http://www.ruby-forum.com/.

More information about the rspec-users mailing list