import Nimble
import Result

public func beVoid() -> MatcherFunc<Void> {
  return MatcherFunc { actualExpression, failureMessage in
    failureMessage.postfixMessage = "equal ()"

    let actualValue: Void? = try actualExpression.evaluate()
    switch actualValue {
    case ()?: return true
    default: return false
    }
  }
}

public func beSuccessful<T, E>() -> NonNilMatcherFunc<Result<T, E>> {
  return NonNilMatcherFunc { actual, failure in
    let result = try actual.evaluate()

    switch result {
    case .Success?: return true
    default: return false
    }
  }
}

import Nimble
import Result

public func beVoid() -> MatcherFunc<Void> {
  return MatcherFunc { actualExpression, failureMessage in
    failureMessage.postfixMessage = "equal ()"

    let actualValue = try actualExpression.evaluate()
    switch actualValue {
    case .Some(()):
      return true
    default:
      return false
    }
  }
}

public func beSuccessful<T, E>() -> NonNilMatcherFunc<Result<T, E>> {
  return NonNilMatcherFunc { actual, failure in
    let result = try actual.evaluate()

    switch result {
    case .Success?: return true
    default: return false
    }
  }
}

--- 
+++ 
@@ -5,12 +5,10 @@
   return MatcherFunc { actualExpression, failureMessage in
     failureMessage.postfixMessage = "equal ()"
 
-    let actualValue = try actualExpression.evaluate()
+    let actualValue: Void? = try actualExpression.evaluate()
     switch actualValue {
-    case .Some(()):
-      return true
-    default:
-      return false
+    case ()?: return true
+    default: return false
     }
   }
 }
Fix warning in `beVoid` matcher

Previously we weren't being explicit about the fact that this expression
evaluation was expected to return `Void?`. Since this is a fairly
unusual return type, Xcode was throwing warnings about it, which dirtied
the project's build status and was generally noisy.

To fix this, we can be explicit about expecting `Void?`.

While I'm at it, I'll take the time to clean up the implementation a
little.
