2010-12-21 14 views

答えて

8

RSpecのは、HTML形式の出力を生成するためのコマンドラインオプションを持っている

rspec /directory/containing/specs/** --format h > output.html 

私は私のレールのアプリのルートからこれを実行します/ **以下のパスを指定してください。 私はそれが助けてくれることを願っています。 "_spec.rb"以外のファイルがある場合は、パス引数を変更する必要があります。

+0

bascially私の問題は、私はレポートを生成するには、この可能単一のHTML file.Is内のすべてのコントローラの私のすべてのテストケースのHTML形式のレポートを生成したいということです???? –

23

、その非常に単純:

+4

"--out out.html"の代わりに "> out.html"を使用した場合の問題は、rspecコマンドが '<!DOCTYPE html>の上のHTMLファイルにエコーされるということです。 –

4

シナリオ

https://www.relishapp.com/rspec/rspec-core/docs/command-line/format-optionから:私はrspec example_spec.rb --format progress --format documentation --out rspec.txt

を実行すると、出力が ".F *"

およびファイル "rspec.txt" を含める必要があり、複数の形式

something does something that passes does something that fails (FAILED - 1) does something that is pending (PENDING: No reason given) 
ジェンキンスを使用してそれらのため
4

を見て。

我々は.rspecする

--format html 
--out rspec_results.html 

を追加することができますフォーマットに

rspec spec/* --format html --out report.html 
9

を指定する-fまたは--formatオプションを使用し

rspec_results.htmlする結果を書き込みますので、RSpecの

を参照してください。

関連する問題