Merge pull request #26 from atomic111/master

add json format option
This commit is contained in:
Dominik Richter 2015-01-14 13:50:02 +01:00
commit a517ad6040
2 changed files with 2 additions and 1 deletions

View file

@ -40,5 +40,5 @@ bundle exec rake serverspec:default target_host=<name-or-ip-of-target-server>
ASK_LOGIN_PASSWORD=true bundle exec rake serverspec:default target_host=192.168.1.222 user=stack
```
add `format=html` to get a report.html document
add `format=html|json` to get a report.html or report.json document

View file

@ -37,6 +37,7 @@ namespace :serverspec do
desc "Run serverspec suite #{suite}"
ServerspecTask.new(suite.to_sym) do |t|
t.rspec_opts = '--no-color --format html --out report.html' if ENV['format'] == 'html'
t.rspec_opts = '--no-color --format json --out report.json' if ENV['format'] == 'json'
t.target = ENV['TARGET_HOST'] || ENV['target_host']
t.ruby_opts = "-I #{suite}/serverspec"
t.pattern = "#{suite}/serverspec/*_spec.rb"