Use standard status text

This commit is contained in:
Michael Miller 2019-03-23 16:34:54 -06:00
parent ff20fbe232
commit 50929c6666
4 changed files with 19 additions and 1 deletions

View file

@ -10,6 +10,11 @@ module Spectator::Formatting
def initialize(@result : FailedResult) def initialize(@result : FailedResult)
end end
# Status string specific to the result type.
private def status
"FAIL"
end
# Adds the failed expectations to the XML block. # Adds the failed expectations to the XML block.
private def content(xml) private def content(xml)
super super

View file

@ -12,7 +12,7 @@ module Spectator::Formatting
private def attributes private def attributes
{ {
name: result.example, name: result.example,
status: result, status: status,
classname: classname, classname: classname,
} }
end end
@ -20,6 +20,9 @@ module Spectator::Formatting
# Result to pull values from. # Result to pull values from.
private abstract def result private abstract def result
# Status string specific to the result type.
private abstract def status : String
# Adds additional content to the "testcase" XML block. # Adds additional content to the "testcase" XML block.
# Override this to add more content. # Override this to add more content.
private def content(xml) private def content(xml)

View file

@ -10,6 +10,11 @@ module Spectator::Formatting
def initialize(@result : PendingResult) def initialize(@result : PendingResult)
end end
# Status string specific to the result type.
private def status
"TODO"
end
# Adds the skipped tag to the XML block. # Adds the skipped tag to the XML block.
private def content(xml) private def content(xml)
super super

View file

@ -7,5 +7,10 @@ module Spectator::Formatting
# Creates the JUnit test case. # Creates the JUnit test case.
def initialize(@result : SuccessfulResult) def initialize(@result : SuccessfulResult)
end end
# Status string specific to the result type.
private def status
"PASS"
end
end end
end end