Permalink
Browse files

fix(core): More meaningful reporting on TakeNotes and CompareNotes

  • Loading branch information...
jan-molak committed Feb 19, 2017
1 parent 0a4b08e commit 9aeefc5757bebbed58b0104b6f878ab9ca2256e2
@@ -11,7 +11,7 @@ export class CompareNotes<S> implements Interaction {
return new CompareNotes<A>(actual, expectation, topic.toString());
}
@step('{0} compares notes on #actual', ActivityType.Interaction)
@step('{0} compares notes on #subject', ActivityType.Interaction)
performAs(actor: UsesAbilities & AnswersQuestions): PromiseLike<void> {
return TakeNotes.
as(actor).
@@ -21,4 +21,8 @@ export class CompareNotes<S> implements Interaction {
constructor(private actual: Question<OneOrMany<S>>, private expect: Expectation<OneOrMany<S>>, private topic: string) {
}
private subject = () => `${ this.actual }` === `${ this.topic }`
? `${ this.actual }`
: `${ this.actual } (noted as "${this.topic})`
}
@@ -6,11 +6,15 @@ export class TakeNote<T> implements Interaction {
as = (topic: string) => (this.topic = topic, this);
@step('{0} takes a note of #topic', ActivityType.Interaction)
@step('{0} takes a note of #subject', ActivityType.Interaction)
performAs(actor: UsesAbilities): PromiseLike<void> {
return TakeNotes.as(actor).note(this.topic.toString(), this.question.answeredBy(actor));
}
constructor(private question: Question<T>, private topic: { toString: () => string }) {
}
private subject = () => `${ this.question }` === `${ this.topic }`
? `${ this.question }`
: `${ this.question } (noted as "${this.topic})`
}

0 comments on commit 9aeefc5

Please sign in to comment.