keeganwitt / gmock

Automatically exported from code.google.com/p/gmock
6 stars 2 forks source link

using anything() causes groovy.lang.MissingMethodException #98

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
gmock version 0.8.1
gmaven-runtime-1.7

Running the Gmock VS jMock, anything() doesn't work.

Code to reproduce:

package anything

import org.gmock.WithGMock
import org.junit.Test

@WithGMock
class MockAnythingTest {

  @Test
  void testAnything() {

    def mock = mock(List)

    mock.clear().times(3)
    mock.add(anything()).returns(true).atLeastOnce()

    play {
      mock.clear()
      mock.clear()
      mock.clear()
      mock.add("")
    }
  }
}

Original issue reported on code.google.com by edward.p...@gmail.com on 28 Sep 2010 at 1:49

GoogleCodeExporter commented 8 years ago
Exception is:

groovy.lang.MissingMethodException: No signature of method: 
anything.MockAnythingTest.anything() is applicable for argument types: () 
values: []

Original comment by edward.p...@gmail.com on 28 Sep 2010 at 2:04

GoogleCodeExporter commented 8 years ago
Sorry, my bad!

Need to import static org.hamcrest.Matchers.anything

Please close this issue.

Original comment by edward.p...@gmail.com on 28 Sep 2010 at 2:31

GoogleCodeExporter commented 8 years ago

Original comment by JohnnyJianHY on 28 Sep 2010 at 4:07