2010-07-12 11 views
6

Acabo de instalar el pepino, y lo probé. Tengo el siguiente error:Errores de pepino suprimidos (no se muestran por completo)

teefcomp:cucumber-intro teef$ cucumber features/manage_users.feature 
Using the default profile... 
F----F 

Failing Scenarios: 
cucumber features/manage_users.feature:6 # Scenario: User List 

1 scenario (1 failed) 
4 steps (4 skipped) 
0m0.029s 

Parece ser que suprime el error. Me esperaba algo como:

Feature: Manage users 
    In order to understand my user base better 
    As an administrator 
    I want to view a list of users 

    Scenario: User List 
    Given I have users named George, Mary 
     uninitialized constant User (NameError) 
     ./features/step_definitions/user_steps.rb:3 
     ./features/step_definitions/user_steps.rb:2:in '/^I have users named (.*)$/' 
     features/manage_users.feature:7:in 'Given I have users named George, Mary' 

Alguien sabe cómo conseguir el pepino para mostrar los errores en su totalidad?

--backtrace, --verbose, -b y --trace no funcionan; Sigo viendo F----F y el escenario que falla está en la lista, pero todavía espero algo así como la descripción en la línea "NameError". ¿Es esta una característica de una versión anterior de pepino? (Estoy usando grabaciones de pantalla para empezar a utilizar el pepino.)

Respuesta

12

correr con la bandera -b debería darle una traza completa

cucumber features/manage_users.feature -b 

EDIT:

Además, puede utilizar la notación completa de --backtrace . Si está ejecutando a través de rake, ejecute con el indicador --trace

para obtener la salida completa, puede usar el indicador --format. Generalmente uso --format pretty para obtener un recorrido línea por línea.

de la salida --help.

-f, --format FORMAT    How to format features (Default: pretty). Available formats: 
            debug  : For developing formatters - prints the calls made to the listeners. 
            html  : Generates a nice looking HTML report. 
            json  : Prints the feature as JSON 
            json_pretty : Prints the feature as pretty JSON 
            junit  : Generates a report similar to Ant+JUnit. 
            pdf   : Generates a PDF report. You need to have the 
               prawn gem installed. Will pick up logo from 
               features/support/logo.png or 
               features/support/logo.jpg if present. 
            pretty  : Prints the feature as is - in colours. 
            progress : Prints one character per scenario. 
            rerun  : Prints failing files with line numbers. 
            stepdefs : Prints All step definitions with their locations. Same as 
               the usage formatter, except that steps are not printed. 
            tag_cloud : Prints a tag cloud of tag usage. 
            usage  : Prints where step definitions are used. 
               The slowest step definitions (with duration) are 
               listed first. If --dry-run is used the duration 
               is not shown, and step definitions are sorted by 
               filename instead. 
           Use --format rerun --out features.txt to write out failing 
           features. You can rerun them with cucumber @rerun.txt. 
           FORMAT can also be the fully qualified class name of 
           your own custom formatter. If the class isn't loaded, 
           Cucumber will attempt to require a file with a relative 
           file name that is the underscore name of the class name. 
           Example: --format Foo::BarZap -> Cucumber will look for 
           foo/bar_zap.rb. You can place the file with this relative 
           path underneath your features/support directory or anywhere 
           on Ruby's LOAD_PATH, for example in a Ruby gem. 
+0

Hmm, eso todavía no me da el completo bt. Obtuve el mismo resultado ... – user5243421

+0

intento '--backtrace' y' --verbose' –

+0

Ambos me dan información adicional, sin embargo, la información más útil (la línea "Usuario constante no inicializado (NameError)") todavía se muestra. – user5243421

0

Si la aplicación es una aplicación Rails, puede utilizar la @ permiten rescate etiqueta para el escenario de intereses, entonces sus rieles test_log incluirán más detalles sobre el origen de su solicitud fue planteada inicialmente el error .

Desde la línea de comandos, puede ver rápidamente el final del registro de prueba con la cola -n200 log/test_log.rb (ajuste el número de líneas para ver la porción de interés).

Cuestiones relacionadas