                     messageLabel.text = "One Infinite Loop Cupertino, CA 95014"
                     messageLabel.enabledDetectors = [.address]
                     let attributes = messageLabel.textAttributes
-                    let textColor = attributes?[.foregroundColor] as? UIColor
-                    expect(textColor).toNot(beNil())
+                    let textColor = attributes[.foregroundColor] as? UIColor
                     expect(textColor).to(equal(expectedColor))
                 }
             }

                    messageLabel.text = "Today"
                    messageLabel.enabledDetectors = [.date]
                    let attributes = messageLabel.textAttributes
                    let textFont = attributes?[.font] as? UIFont
                    expect(textFont).toNot(beNil())
                    expect(textFont).to(equal(expectedFont))
                }
            }


fileprivate extension MessageLabel {

    var textAttributes: [NSAttributedStringKey: Any] {
        let length = attributedText!.length
        var range = NSRange(location: 0, length: length)
        return attributedText!.attributes(at: 0, effectiveRange: &range)
    }
}
