Skip to content

Commit

Permalink
Merge branch 'feature-dotty-inspector-asserting' of https://github.co…
Browse files Browse the repository at this point in the history
  • Loading branch information
cheeseng committed Dec 12, 2023
2 parents 654387a + f3dba0b commit eaae417
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 902 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -341,22 +341,22 @@ abstract class UnitInspectorAsserting {
* Abstract class that in the future will hold an intermediate priority <code>InspectorAsserting</code> implicit, which will enable inspector expressions
* that have result type <code>Expectation</code>, a more composable form of assertion that returns a result instead of throwing an exception when it fails.
*/
/*abstract class ExpectationInspectorAsserting extends UnitInspectorAsserting {
abstract class ExpectationInspectorAsserting extends UnitInspectorAsserting {

private[scalatest] implicit def assertingNatureOfExpectation(implicit prettifier: Prettifier): InspectorAsserting[Expectation] { type Result = Expectation } = {
new InspectorAssertingImpl[Expectation] {
type Result = Expectation
def indicateSuccess(message: => String): Expectation = Fact.Yes(message)(prettifier)
def indicateFailure(message: => String, optionalCause: Option[Throwable], pos: source.Position): Expectation = Fact.No(message)(prettifier)
private[scalatest] implicit def assertingNatureOfExpectation(implicit prettifier: Prettifier): InspectorAsserting[Expectation, Expectation] = {
new InspectorAssertingImpl[Expectation, Expectation] {
def indicateSuccess(message: => String): Expectation = Fact.Yes(message, prettifier)
def indicateFailure(message: => String, optionalCause: Option[Throwable], pos: org.scalactic.source.Position): Expectation = Fact.No(message, prettifier)
def indicateFailure(message: => String, optionalCause: Option[Throwable], pos: source.Position, analysis: scala.collection.immutable.IndexedSeq[String]): Expectation = Fact.No(message, prettifier)
}
}
}*/
}

/**
* Companion object to <code>InspectorAsserting</code> that provides two implicit providers, a higher priority one for passed functions that have result
* type <code>Assertion</code>, which also yields result type <code>Assertion</code>, and one for any other type, which yields result type <code>Unit</code>.
*/
object InspectorAsserting extends UnitInspectorAsserting /*ExpectationInspectorAsserting*/ {
object InspectorAsserting extends ExpectationInspectorAsserting {

/**
* Provides an implicit <code>InspectorAsserting</code> instance for type <code>Assertion</code>,
Expand Down
Loading

0 comments on commit eaae417

Please sign in to comment.