Commits

Michael Granger committed 53348dd

Cleanup the failure callback and use the snippet extractor even for failed-pending examples

Comments (0)

Files changed (1)

lib/rspec/core/formatters/webkit.rb

 		counter   = self.failcounter += 1
 		exception = example.metadata[:execution_result][:exception_encountered]
 		extra     = self.extra_failure_content( exception )
-		status    = if exception.is_a?( RSpec::Core::PendingExampleFixedError )
-			then 'pending-fixed'
-			else 'failed'
-			end
-		template  = if status == 'pending-fixed'
+		template  = if exception.is_a?( RSpec::Core::PendingExampleFixedError )
 			then @example_templates[:pending_fixed]
 			else @example_templates[:failed]
 			end
 	### Return any stuff that should be appended to the current example
 	### because it's failed. Returns a snippet of the source around the
 	### failure.
-	def extra_failure_content( failure )
-		return '' if failure.is_a?( RSpec::Core::PendingExampleFixedError )
-		snippet = @snippet_extractor.snippet( failure.exception )
+	def extra_failure_content( exception )
+		snippet = @snippet_extractor.snippet( exception )
 		return "    <pre class=\"ruby\"><code>#{snippet}</code></pre>"
 	end