mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Add predicate method to check for description
This commit is contained in:
parent
ff2cbcd4c7
commit
00fe913d77
1 changed files with 6 additions and 5 deletions
|
@ -8,18 +8,19 @@ module Spectator
|
|||
# Used to instantiate tests and run them.
|
||||
struct TestWrapper
|
||||
# Description the user provided for the test.
|
||||
getter description
|
||||
def description
|
||||
@description || @source.to_s
|
||||
end
|
||||
|
||||
# Location of the test in source code.
|
||||
getter source
|
||||
|
||||
# Creates a wrapper for the test.
|
||||
def initialize(@description : String, @source : Source, @test : ::SpectatorTest, @runner : TestMethod)
|
||||
def initialize(@description : String?, @source : Source, @test : ::SpectatorTest, @runner : TestMethod)
|
||||
end
|
||||
|
||||
# Creates a wrapper for the test.
|
||||
def initialize(description : Nil, @source : Source, @test : ::SpectatorTest, @runner : TestMethod)
|
||||
@description = @source.to_s
|
||||
def description?
|
||||
!@description.nil?
|
||||
end
|
||||
|
||||
def run
|
||||
|
|
Loading…
Reference in a new issue