But is that true? It would be an invalid use to provide null as an
*expected* value, but in this case it's probably my code under test that
screwed up and returned null.

It's hard to suggest messages unless I'm looking at a coherent list of all
the messages truth uses in various situations to get a feel for its style.


On Mon, May 19, 2014 at 3:34 PM, Christian Edward Gruber <
notifications@github.com> wrote:

> In core/src/test/java/org/truth0/subjects/OptionalSubjectTest.java:
>
> > +    ASSERT.that(Optional.of("foo")).hasValue("foo");
> > +  }
> > +
> > +  @Test public void hasValue_FailingWithAbsent() {
> > +    try {
> > +      ASSERT.that(Optional.absent()).hasValue("foo");
> > +      fail("Should have thrown");
> > +    } catch (AssertionError expected) {
> > +      ASSERT.that(expected.
> getMessage())
> > +          .isEqualTo("<Optional.absent()> cannot have the value <foo>");
> > +    }
> > +  }
> > +
> > +  @Test public void hasValue_FailingWithNullParameter() {
> > +    try {
> > +      ASSERT.that(Optional.of("foo")).hasValue(null);
>
> Added a test. Don't think it should. It's not a truthy error - it's an
> entirely invalid use of the test framework.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/truth0/truth/pull/87/files#r12820103>
> .
>



-- 
Kevin Bourrillion | Java Librarian | Google, Inc. | kevinb@google.com