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

Comparision of Iterator fails #2

Open
opensource21 opened this issue Apr 2, 2013 · 1 comment
Open

Comparision of Iterator fails #2

opensource21 opened this issue Apr 2, 2013 · 1 comment

Comments

@opensource21
Copy link

I have the follwing test using Mockito and fest-assert Version 1.4. Assert.assertEquals is the normal JUnit-assert.

   @Test
    public void bugReport() {
        // Arrange
        final Iterator<String> result = mock(Iterator.class);
        final List<String> listMock = mock(List.class);
        when(listMock.iterator()).thenReturn(result);

        // Act
        final Iterator<String> testResult = listMock.iterator();
        // Assert
        Assert.assertSame(result, testResult);
        assertThat(testResult).isEqualTo(result);
    }

It fails at the last line. The problem is that is compares a org.fest.assertions.IteratorAssert.PrettyPrintIterator with result. This fails.

@opensource21
Copy link
Author

Same for Type java.util.ListIterator<String>.

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

1 participant