Skip to content

Commit

Permalink
BeNil: subclass Equal
Browse files Browse the repository at this point in the history
  • Loading branch information
modocache committed Jun 10, 2014
1 parent 243748f commit 4527c64
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions Quick/Expectations/Matchers/BeNil.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@

import Foundation

class BeNil: Matcher {
class BeNil: Equal {
init() {
super.init(true)
// BeNil is equivalent to Equal(nil)
super.init(nil)
}

override func failureMessage(actual: NSObject?) -> String {
Expand All @@ -20,11 +21,6 @@ class BeNil: Matcher {
override func negativeFailureMessage(actual: NSObject?) -> String {
return "expected '\(actual)' to be non-nil"
}

override func match(actual: NSObject?) -> Bool {

return actual == nil
}
}

extension Prediction {
Expand Down

0 comments on commit 4527c64

Please sign in to comment.