<commit_before>//  Copyright © 2017 Outware Mobile. All rights reserved.

/// Scenarios which are being built whose most recent declaration can be extended.
///
/// e.g.
/// - Arranging (Preparing):
///     Arranging pre-conditions for scenarios can be extended by doing further setup.
/// - Acting:
///     Acting on scenarios can be extended by doing further manipulation of
///     model objects / user interface, for example.
/// - Asserting: 
///     Asserting results for scenarios can be extended by asserting multiple results.
public protocol Extendable {

  /// Specifies an extension to the most recent declaration of the scenario.
  ///
  /// - parameters:
  ///     - description: The specification to add to the scenario.
  ///
  /// - returns: A scenario which captures all specifications in the previous scenario
  ///            as well as the new specification.
  func And(_ description: String, file: String, line: UInt) -> Self

}


/// Scenarios which have yet to have any specification as to how they should be
/// prepared / how the conditions for the scenario should be __arranged__.
public protocol Preparable {

  /// Specifies the preparation / arrangement step for the scenario.
  ///
  /// - parameters:
  ///     - description: A specification detailing how the scenario should be prepared.
  ///
  /// - returns: A scenario which has had some preparation / arranging done.
  ///
  /// - seealso: Extendable
  func Given(_ description: String, file: String, line: UInt) -> Prepared

}


/// Scenarios for which the steps to carry out the tests which they capture have not
/// yet been specified.
public protocol Actionable {

  /// Specifies the action step for the scenario.
  ///
  /// - parameters:
  ///     - description: A specification detailing how the scenario should be acted upon.
  ///
  /// - returns: A scenario which has had some action performed.
  ///
  /// - seealso: Extendable
  func When(_ description: String, file: String, line: UInt) -> Actioned

}


/// Scenarios which have had some action / manipulation performed, and are ready to have
/// results be asserted.
public protocol Assertable {

  /// Specifies the assertion step for the scenario.
  ///
  /// - parameters:
  ///     - description: A specification detailing how the scenario's should have its
  ///                    state be confirmed.
  ///
  /// - seealso: Extendable
  func Then(_ description: String, file: String, line: UInt) -> Asserted
  
}


/// Instances of conforming types are able to build scenarios by collecting multiple
/// components (types which are `Preparable`, `Actionable`, `Assertable`) as they are
/// built-up, and commiting the result to the test harness.
internal protocol ScenarioBuilder {

  /// Adds a specification to the scenario to-be-built.
  ///
  /// - note: Agnostic to the current stage of the built-up scenario.
  ///
  /// - parameters:
  ///     - description: A specification detailing the steps to be appended to the
  ///                    current state of the scenario.
  mutating func add(stepWithDescription description: String, file: String, line: UInt)

}<commit_msg>Clarify some documentation on the roles in building scenarios<commit_after>//  Copyright © 2017 Outware Mobile. All rights reserved.

/// Scenarios which are being built whose most recent declaration can be extended.
///
/// e.g.
/// - Arranging (Preparing):
///     Arranging pre-conditions for scenarios can be extended by doing further setup.
/// - Acting:
///     Acting on scenarios can be extended by doing further manipulation of
///     model objects / user interface, for example.
/// - Asserting: 
///     Asserting results for scenarios can be extended by asserting multiple results.
public protocol Extendable {

  /// Specifies an extension to the most recent declaration of the scenario.
  ///
  /// - parameters:
  ///     - description: The specification to add to the scenario.
  ///
  /// - returns: A scenario which captures all specifications in the previous scenario
  ///            as well as the new specification.
  func And(_ description: String, file: String, line: UInt) -> Self

}


/// Scenarios which have yet to have any specification as to how they should be
/// prepared / how the conditions for the scenario should be __arranged__.
public protocol Preparable {

  /// Specifies the preparation / arrangement step for the scenario.
  ///
  /// - parameters:
  ///     - description: A specification detailing how the scenario should be prepared.
  ///
  /// - returns: A scenario which has had some preparation / arranging done.
  ///
  /// - seealso: Extendable
  func Given(_ description: String, file: String, line: UInt) -> Prepared

}


/// Scenarios for which the steps to carry out the tests which they capture have not
/// yet been specified.
public protocol Actionable {

  /// Specifies the action step for the scenario.
  ///
  /// - parameters:
  ///     - description: A specification detailing how the scenario should be acted upon.
  ///
  /// - returns: A scenario which has had some action performed.
  ///
  /// - seealso: Extendable
  func When(_ description: String, file: String, line: UInt) -> Actioned

}


/// Scenarios which have had some action / manipulation performed, and are ready to have
/// results be asserted.
public protocol Assertable {

  /// Specifies the assertion step for the scenario.
  ///
  /// - parameters:
  ///     - description: A specification detailing how the scenario's should have its
  ///                    state be confirmed.
  ///
  /// - seealso: Extendable
  func Then(_ description: String, file: String, line: UInt) -> Asserted
  
}


/// Instances of conforming types build scenarios by collecting multiple
/// components (types which are `Preparable`, `Actionable`, `Assertable`) as they are
/// built-up, and commit the result to the test harness.
internal protocol ScenarioBuilder {

  /// Adds a specification to the scenario to-be-built.
  ///
  /// - note: Agnostic to the current stage of the built-up scenario.
  ///
  /// - parameters:
  ///     - description: A specification detailing the steps to be appended to the
  ///                    current state of the scenario.
  mutating func add(stepWithDescription description: String, file: String, line: UInt)

}
{'fraction_non_alphanumeric': 0.10112537644634649, 'fraction_numerical': 0.0012680297987002695, 'mean_word_length': 2.5529279279279278, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6118803', 'n_tokens_mistral': 1635, 'n_tokens_neox': 1549, 'n_words': 743}