expect.that() error comparing null to String
GoogleCodeExporter opened this issue · comments
What steps will reproduce the problem?
1. Compile attached code
2. Run with JUnit4 (note @RunWith annotation)
3. Notice Specification "shouldLeaveValueOnStackAfterPeep()" passes
What is the expected output? What do you see instead?
I'd expect to get a failure for this specification/test since pop() is
always returning a null and that shouldn't be equal to a String.
What version of the product are you using? On what operating system?
Instinct 0.1.5 on Ubuntu Linux 7.10
Please provide any additional information below.
I was running the attached code for StackBehavior within an Eclipse 3.4M3
environment on Linux with Java 1.5.0_14 when I noticed this. Maybe I'm
missing something, but shouldn't the expect.that() in this function return
a failure?
Original issue reported on code.google.com by ntk...@gmail.com
on 15 Nov 2007 at 9:23
Attachments:
Hey, thanks for that. I'm unable to reproduce on the latest code base. I'll
push out
a new release that should address your problems.
I get the following error, which I assume is what you were expecting:
java.lang.AssertionError:
Expected: same(null)
got: <1>
at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:21)
at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:8)
at
com.googlecode.instinct.internal.edge.org.hamcrest.MatcherAssertEdgeImpl.expectT
hat(MatcherAssertEdgeImpl.java:25)
at
com.googlecode.instinct.expect.state.ObjectCheckerImpl.sameInstanceAs(ObjectChec
kerImpl.java:90)
at
com.googlecode.instinct.example.stack.ANonEmptyStack.leavesValueOnStackAfterPeek
(ANonEmptyStack.java:71)
BTW, how's Instinct work on Eclipse? Is the JUnit integration functioning OK? I
don't
know anyone who uses Eclipse, and haven't tried it myself, so am unsure of the
integration. Thanks again.
Original comment by tomjad...@gmail.com
on 15 Nov 2007 at 10:07
- Changed state: Invalid