lib/fix/expectation.rb in fix-0.1.0 vs lib/fix/expectation.rb in fix-0.2.0

- old
+ new

@@ -15,21 +15,29 @@ ExpectationSet.instance.add self end private - def pass? report - report.pass? + def pass? result, _subject = nil + result.equal? true end - def presenter report, got + def exception result + result unless [ true, false ].include? result + end + + def negated? + !@positive + end + + def presenter result, got, subject = nil { - pass: pass?(report), - negated: report.negated, - matcher: report.matcher, - expected: report.expected, - exception: report.exception, + pass: pass?(result, subject), + negated: negated?, + matcher: @matcher, + expected: @expected, + exception: exception(result), got: got } end def meta subject @@ -40,9 +48,9 @@ subject_exception: subject.error } end def target - @positive ? :to : :not_to + negated? ? :not_to : :to end end end