Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matcher ScalarHasValue has to override describeMismatchSafely for better output #816

Closed
proshin-roman opened this issue May 4, 2018 · 5 comments

Comments

@proshin-roman
Copy link
Contributor

Currently, ScalarHasValue doesn't override method describeMismatchSafely that leads to the next problem:

final ScalarHasValue<String> matcher =
    new ScalarHasValue<>(new IsEqual<>("expected"));
final Scalar<String> scalar = new UncheckedScalar<>(() -> "actual");
final StringDescription description = new StringDescription();
matcher.describeMismatch(scalar, description);
System.out.println(description.toString());
// the out is:
// was <org.cactoos.scalar.UncheckedScalar@368239c8>
// how it should look like:
// was "actual"

so it prints an actual version incorrectly: default toString method is called for the Scalar.

Expected:

  • the value of scalar is printed as an actual value of matching.

What should be fixed

  • class ScalarHasValue has to override method describeMismatchSafely and convert Scalar to String properly.
@0crat
Copy link
Collaborator

0crat commented May 4, 2018

@llorllale/z please, pay attention to this issue

@llorllale
Copy link
Contributor

@proshin-roman let's put this on hold while #751 is sorted out

@proshin-roman
Copy link
Contributor Author

@llorllale yeah, ok, let's wait

@llorllale
Copy link
Contributor

@proshin-roman matchers were moved to llorllale/cactoos-matchers as per #751. Please open this issue here

@0crat
Copy link
Collaborator

0crat commented May 12, 2018

There is an unrecoverable failure on my side. Please, submit it here:

PID: 4@25988aaf-ee2f-4146-a0f5-fd10756db4a7, thread: AsyncFlush-4
com.zerocracy.farm.reactive.StkGroovy[125] java.lang.IllegalStateException: java.lang.reflect.InvocationTargetException in com/zerocracy/stk/pm/in/orders/close_job.groovy
sun.reflect.NativeMethodAccessorImpl[-2] java.lang.reflect.InvocationTargetException: null
com.zerocracy.farm.strict.StrictProject[111] java.lang.IllegalArgumentException: File "blanks/proshin-roman.xml" is not accessible in "PMO"

1.0-SNAPSHOT: CID: 1321938267, Type: 'Close job', Author: llorllale

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants