* 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
/*
Delete this later:
class ArithmeticSuite extends FunSuite with matchers.ShouldMatchers {
test("addition works") {
1 + 1 should equal (2)
}
ignore("subtraction works") {
1 - 1 should equal (0)
}
test("multiplication works") {
1 * 1 should equal (2)
}
test("division works") (pending)
}
*/
/**
* Trait whose instances provide a <code>run</code> method and configuration fields that implement
* the <em>ScalaTest shell</em>: its DSL for the Scala interpreter.
*
* <p>
* The main command of the ScalaTest shell is <code>run</code>, which you can use to run a suite of tests.
* The shell also provides several commands for configuring a call to <code>run</code>:
* </p>
*
* <ul>
* <li><code>color</code> (the default) - display results in color (green for success; red for failure; yellow for warning; blue for statistics)</li>
* <li><code>nocolor</code> - display results without color</li>
* <li><code>durations</code> - display durations of (<em>i.e.</em>, how long it took to run) tests and suites</li>
* <li><code>nodurations</code> (the default) - do not display durations of tests and suites</li>
* <li><code>shortstacks</code> - display short (<em>i.e.</em>, truncated to show just the most useful portion) stack traces for all exceptions</li>
* <li><code>fullstacks</code> - display full stack trackes for all exceptions</li>
* <li><code>nostacks</code> (the default) - display no stack trace for <code>StackDepth</code> exceptions and a short stack trace for non-<code>StackDepth</code>
* exceptions</li>
* <li><code>stats</code> - display statistics before and after the run, such as expected test count before the run and tests succeeded, failed, pending,
* <em>etc.</em>, counts after the run</li>
* <li><code>nostats</code> (the default) not display statistics before or after the run</li>
* </ul>
*
* <p>
* The default configuration is <code>color</code>, <code>nodurations</code>, <code>nostacks</code>, and <code>nostats</code>.
* </p>
*
* <p>
* All of these commands are fields of trait <code>org.scalatest.Shell</code>. Each configuration command is a field that refers to
* another <code>Shell</code> instance with every configuration parameter
* the same except for the one you've asked to change. For example, <code>durations</code> provides a
* <code>Shell</code> instance that has every parameter configured the same way, except with durations enabled. When you invoke
* <code>run</code> on that, you will get a run with durations enabled and every other configuration parameter at its default value.
* <p>
*
* <p>
* Two other useful "commands"
* to know about, though not technically part of the shell, are the <code>apply</code> factory methods in the <a href="Suites$.html"><code>Suites</code></a> and <a href="Specs$.html"><code>Specs</code></a>
* singleton objects. These allow you to easily create composite suites out of nested suites, which you can then pass to <code>run</code>. This
* will be demonstrated later in this documentation.
* </p>
*
* <h2>Using the ScalaTest shell</h2>
*
* <p>
* The package object of the <code>org.scalatest</code> package, although it does not extend <code>Shell</code>, declares all the
* same members as <code>Shell</code>. Its <code>run</code> method runs with all the <code>Shell</code> configuration parameters set
* to their default values. A good way to use the ScalaTest shell, therefore, is to import the members of package <code>org.scalatest</code>:
* A <code>Shell</code> whose <code>run</code> method will pass <code>true</code> for <code>execute</code>'s <code>color</code>
* parameter, and pass for all other parameters the same values as this <code>Shell</code>.
*/
val color: Shell
/**
* A <code>Shell</code> whose <code>run</code> method will pass <code>true</code> for <code>execute</code>'s <code>durations</code>
* parameter, and pass for all other parameters the same values as this <code>Shell</code>.
*/
val durations: Shell
/**
* A <code>Shell</code> whose <code>run</code> method will pass <code>true</code> for <code>execute</code>'s <code>shortstacks</code>
* parameter and <code>false</code> for its <code>fullstacks</code> parameter, and pass for all other parameters the same values as
* this <code>Shell</code>.
*/
val shortstacks: Shell
/**
* A <code>Shell</code> whose <code>run</code> method will pass <code>false</code> for <code>execute</code>'s <code>shortstacks</code>
* parameter and <code>true</code> for its <code>fullstacks</code> parameter, and pass for all other parameters the same values as this <code>Shell</code>.
*/
val fullstacks: Shell
/**
* A <code>Shell</code> whose <code>run</code> method will pass <code>true</code> for <code>execute</code>'s <code>stats</code>
* parameter, and pass for all other parameters the same values as this <code>Shell</code>.
*/
val stats: Shell
/**
* Returns a copy of this <code>Shell</code> with <code>colorPassed</code> configuration parameter set to <code>false</code>.
*/
val nocolor: Shell
/**
* Returns a copy of this <code>Shell</code> with <code>durationsPassed</code> configuration parameter set to <code>false</code>.
*/
val nodurations: Shell
/**
* Returns a copy of this <code>Shell</code> with <code>shortStacksPassed</code> configuration parameter set to <code>false</code>.
*/
val nostacks: Shell
/**
* Returns a copy of this <code>Shell</code> with <code>statsPassed</code> configuration parameter set to <code>false</code>.
*/
val nostats: Shell
/**
* Run the passed suite, optionally passing in a test name and config map.
*
* <p>
* This method will invoke <code>execute</code> on the passed <code>suite</code>, passing in
* the specified (or default) <code>testName</code> and <code>configMap</code> and a set of configuration values. A
* particular <code>Shell</code> instance will always pass the same configuration values (<code>color</code>,
* <code>durations</code>, <code>shortstacks</code>, <code>fullstacks</code>, and <code>stats</code>) to <code>execute</code> each time
refactored Shell so case class generated
methods like copy don't show up when
importing org.scalatest._; wrote tests and
fixed a bug discovered that way