Browse files

Prepend image to wiki results

  • Loading branch information...
1 parent 65d322c commit f10cfccd12f2bda5a5dd634093702fe91a3cee5a @stewart stewart committed Dec 17, 2012
Showing with 10 additions and 1 deletion.
  1. +10 −1 lib/gitnesse/wiki.rb
View
11 lib/gitnesse/wiki.rb
@@ -127,7 +127,16 @@ def append_results(scenario)
if page.name == filename || page.name == "#{filename}.feature"
if page.text_data.include? scenario.name
content = page.raw_data
- string = "\n\`Last result was #{scenario.status.to_s.upcase}: #{scenario.name} (#{Time.now.to_s} - #{Gitnesse.configuration.info})\`\n"
+
+ case scenario.status
+ when :undefined then image = "![](https://s3.amazonaws.com/gitnesse/github/undefined.png)"
+ when :passed then image = "![](https://s3.amazonaws.com/gitnesse/github/passing.png)"
+ when :failed then image = "![](https://s3.amazonaws.com/gitnesse/github/failing.png)"
+ when :pending then image = "![](https://s3.amazonaws.com/gitnesse/github/pending.png)"
+ else image = "![](https://s3.amazonaws.com/gitnesse/github/undefined.png)"
+ end
+
+ string = "\n#{image} \`Last result was #{scenario.status.to_s.upcase}: #{scenario.name} (#{Time.now.to_s} - #{Gitnesse.configuration.info})\`\n"
content.gsub(string, '')
content << string
@wiki.update_page(page, page.name, :markdown, content, @commit_info)

0 comments on commit f10cfcc

Please sign in to comment.