
org.scalatest.GivenWhenThen.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scalatest_2.8.2 Show documentation
Show all versions of scalatest_2.8.2 Show documentation
ScalaTest is a free, open-source testing toolkit for Scala and Java
programmers.
The newest version!
/*
* Copyright 2001-2008 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 that contains methods named given
, when
, then
, and and
,
* which take a string message and implicit Informer
, and forward the message to the informer.
*
* @author Bill Venners
*/
trait GivenWhenThen {
/**
* Forwards a message to an implicit Informer
, preceded by "Given."
*
* @param message the message to forward to the passed informer
* @param info the Informer
to which to forward the message
*/
def given(message: String)(implicit info: Informer) {
info(Resources("givenMessage", message))
}
/**
* Forwards a message to an implicit Informer
, preceded by "When ".
*
* @param message the message to forward to the passed informer
* @param info the Informer
to which to forward the message
*/
def when(message: String)(implicit info: Informer) {
info(Resources("whenMessage", message))
}
/**
* Forwards a message to an implicit Informer
, preceded by "Then ".
*
* @param message the message to forward to the passed informer
* @param info the Informer
to which to forward the message
*/
def then(message: String)(implicit info: Informer) {
info(Resources("thenMessage", message))
}
/**
* Forwards a message to an implicit Informer
, preceded by "And ".
*
* @param message the message to forward to the passed informer
* @param info the Informer
to which to forward the message
*/
def and(message: String)(implicit info: Informer) {
info(Resources("andMessage", message))
}
}
/**
* Companion object that facilitates the importing of GivenWhenThen
members as
* an alternative to mixing it in.
*
* @author Bill Venners
*/
object GivenWhenThen extends GivenWhenThen
© 2015 - 2025 Weber Informatics LLC | Privacy Policy