feat: Working on node builder
This commit is contained in:
@@ -13,10 +13,9 @@ final class CliDocTests: XCTestCase {
|
||||
|
||||
func testStringChecks() {
|
||||
let expected = "Foo".green.bold
|
||||
let notexpected = "Foo"
|
||||
|
||||
XCTAssert("Foo".green.bold == expected)
|
||||
XCTAssert("Foo".green.bold != notexpected)
|
||||
XCTAssert(expected != "Foo")
|
||||
}
|
||||
|
||||
func testRepeatingModifier() {
|
||||
@@ -96,4 +95,35 @@ final class CliDocTests: XCTestCase {
|
||||
"""
|
||||
XCTAssert(node.render() == expected)
|
||||
}
|
||||
|
||||
func testShellCommand() {
|
||||
let node = ShellCommand {
|
||||
"ls -lah"
|
||||
}
|
||||
let expected = " $ ls -lah"
|
||||
XCTAssert(node.render() == expected)
|
||||
}
|
||||
|
||||
func testDiscussion() {
|
||||
let node = Discussion {
|
||||
Group(separator: "\n") {
|
||||
LabeledContent(separator: " ") {
|
||||
"NOTE:".yellow.bold
|
||||
} content: {
|
||||
"Foo"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let expected = """
|
||||
\("NOTE:".yellow.bold) Foo
|
||||
"""
|
||||
|
||||
XCTAssert(node.render() == expected)
|
||||
}
|
||||
|
||||
func testFooNode() {
|
||||
let foo = Foo()
|
||||
XCTAssertNotNil(foo.body as? LabeledContent)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user