All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.scalatest.FailureOf.scala Maven / Gradle / Ivy

The newest version!
/*
 * Copyright 2001-2013 Artima, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.scalatest

/**
 * Trait FailureOf has been deprecated and will be removed in a future version of ScalaTest.
 * Instead of the failureOf method provided by this trait, please use the outcomeOf method
 * provided by trait OutcomeOf instead. 
 *
 * 

* The outcomeOf method is not just the failureOf method with the name changed, so you will likely * need to do a bit of rewriting of your usage of failureOf. The difference is that failureOf * returned an optional Throwable, whereas outcomeOf returns an Outcome. *

* * @author Bill Venners */ @deprecated("The FailureOf trait has been deprecated. Please use trait OutcomeOf instead.") trait FailureOf { @deprecated("The failureOf method of trait FailureOf has been deprecated. Please use the outcomeOf method of trait OutcomeOf instead.") def failureOf(f: => Unit): Option[Throwable] = { try { f None } catch { case e: Throwable => if (!Suite.anExceptionThatShouldCauseAnAbort(e)) Some(e) else throw e } } } @deprecated("The FailureOf object has been deprecated. Please use object OutcomeOf instead.") object FailureOf extends FailureOf




© 2015 - 2024 Weber Informatics LLC | Privacy Policy