2010-05-23 2 views
6

레일 2.3.5를 사용하고 있습니다. .rake spec 잘 작동합니다.레이크 작업을 통해 -f specdoc 옵션을 전달하는 방법

이것은 spec --help의 것입니다.

spec --help 

-f, --format FORMAT[:WHERE]  Specifies what format to use for output. Specify WHERE to tell 
            the formatter where to write the output. All built-in formats 
            expect WHERE to be a file name, and will write to $stdout if it's 
            not specified. The --format option may be specified several times 
            if you want several outputs 

            Builtin formats: 
            silent|l     : No output 
            progress|p    : Text-based progress bar 
            profile|o    : Text-based progress bar with profiling of 10 slowest examples 
            specdoc|s    : Code example doc strings 
            nested|n     : Code example doc strings with nested groups indented 
            html|h     : A nice HTML report 
            failing_examples|e  : Write all failing examples - input for --example 

           failing_example_groups|g : Write all failing example groups - input for --example 

어떻게 rake 작업을 통해 -f specdoc를 전달합니까?

답변

8

.rspec 파일을 레일스 루트에 추가하거나 편집하십시오. 예를 들어, 광산에는 다음과 같은 옵션이 포함됩니다 :

--colour 
--format documentation 

RSpec 2.1의 새 이름은 문서입니다.

7

rake 사양은 SPEC_OPTS 환경 변수를 준수합니다.

rake spec SPEC_OPTS="--format specdoc" 
관련 문제