OneArgTest

org.scalatest.FixtureTestSuite.OneArgTest
See theOneArgTest companion object
protected trait OneArgTest extends FixtureParam => Outcome, TestData

A test function taking a fixture parameter and returning an Outcome.

For more detail and examples, see the documentation for trait fixture.FlatSpec.

Attributes

Companion
object
Graph
Supertypes
trait TestData
class Object
trait Matchable
class Any
Self type

Members list

Value members

Abstract methods

def apply(fixture: FixtureParam): Outcome

Runs the test, using the passed FixtureParam.

Runs the test, using the passed FixtureParam.

Value parameters

fixture

the FixtureParam

Attributes

Returns

an instance of Outcome

Concrete methods

Convert this OneArgTest to a NoArgTest whose name and configMap methods return the same values as this OneArgTest, and whose apply method invokes this OneArgTest's apply method, passing in the given fixture.

Convert this OneArgTest to a NoArgTest whose name and configMap methods return the same values as this OneArgTest, and whose apply method invokes this OneArgTest's apply method, passing in the given fixture.

This method makes it easier to invoke the withFixture method that takes a NoArgTest. For example, if a FixtureSuite mixes in SeveredStackTraces, it will inherit an implementation of withFixture(NoArgTest) provided by SeveredStackTraces that implements the stack trace severing behavior. If the FixtureSuite does not delegate to that withFixture(NoArgTest) method, the stack trace severing behavior will not happen. Here's how that might look in a FixtureSuite whose FixtureParam is StringBuilder:

def withFixture(test: OneArgTest) = {
 withFixture(test.toNoArgTest(new StringBuilder))
}

Invoking this method has no side effect. It just returns a NoArgTest whose apply method invokes apply on this OneArgTest, passing in the FixtureParam passed to toNoArgTest.

Value parameters

fixture

the FixtureParam

Attributes

Returns

an new instance of NoArgTest

Inherited methods

def andThen[A](g: Outcome => A): FixtureParam => A

Attributes

Inherited from:
Function1
def compose[A](g: A => FixtureParam): A => Outcome

Attributes

Inherited from:
Function1
override def toString(): String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Function1 -> Any
Inherited from:
Function1

Inherited fields

A ConfigMap containing objects that can be used to configure the fixture and test.

A ConfigMap containing objects that can be used to configure the fixture and test.

Attributes

Inherited from:
TestData
val name: String

The name of this test.

The name of this test.

See the main documentation for this trait for an explanation of the difference between name, text, and scopes.

Attributes

Inherited from:
TestData
val pos: Option[Position]

Attributes

Inherited from:
TestData
val scopes: IndexedSeq[String]

An immutable IndexedSeq containing the text for any "scopes" enclosing this test, in order from outermost to innermost scope.

An immutable IndexedSeq containing the text for any "scopes" enclosing this test, in order from outermost to innermost scope.

See the main documentation for this trait for an explanation of the difference between name, text, and scopes. If a test has no surrounding scopes, this field will contain an empty IndexedSeq.

Attributes

Inherited from:
TestData
val tags: Set[String]

Tag names for this test.

Tag names for this test.

Attributes

Inherited from:
TestData
val text: String

The "text" for this test.

The "text" for this test.

See the main documentation for this trait for an explanation of the difference between name, text, and scopes. If a test has no surrounding scopes, this field will contain the same string as name.

Attributes

Inherited from:
TestData