Skip to content
This repository was archived by the owner on Jun 7, 2020. It is now read-only.

Commit 7ea400e

Browse files
committed
Fix
1 parent c91ec18 commit 7ea400e

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

Rocket.Chat/Extensions/StringExtensions.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,13 @@ extension String {
137137
let params = components.dropFirst().joined(separator: " ")
138138
return (command: command, params: params)
139139
}
140-
140+
141141
func reaction() -> String? {
142142
guard self.first == "+" && self.count > 1 else { return nil }
143-
143+
144144
let emoji = String(self.dropFirst())
145145
guard emoji.first == ":" && emoji.last == ":" else { return nil }
146-
146+
147147
return emoji
148148
}
149149

Rocket.ChatTests/Extensions/StringExtensionSpec.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,22 +146,22 @@ class StringExtensionSpec: XCTestCase {
146146

147147
XCTAssertNil(string2.commandAndParams())
148148
}
149-
149+
150150
func testReaction() {
151151
let string = "+:upside_down:"
152-
152+
153153
guard let emoji = string.reaction() else {
154154
return XCTFail("string is valid reaction")
155155
}
156-
156+
157157
XCTAssertEqual(emoji, ":upside_down:")
158-
158+
159159
let string2 = ":upside_down:"
160160
XCTAssertNil(string2.reaction())
161-
161+
162162
let string3 = "+upside_down:"
163163
XCTAssertNil(string3.reaction())
164-
164+
165165
let string4 = "+:upside_down"
166166
XCTAssertNil(string4.reaction())
167167
}

0 commit comments

Comments
 (0)