keeganwitt / gmock

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

Support for static method mocking #8

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Support for static method mocking with the given syntax:

def mockLoader = mock(Loader)
mockLoader.static.initialise()

play {
  Loader.initialise()
}

Original issue reported on code.google.com by julien.g...@gmail.com on 11 Oct 2008 at 10:10

GoogleCodeExporter commented 9 years ago

Original comment by julien.g...@gmail.com on 11 Oct 2008 at 10:13

GoogleCodeExporter commented 9 years ago

Original comment by JohnnyJianHY on 11 Oct 2008 at 3:20

GoogleCodeExporter commented 9 years ago

Original comment by julien.g...@gmail.com on 12 Oct 2008 at 9:55

GoogleCodeExporter commented 9 years ago

Original comment by julien.g...@gmail.com on 12 Oct 2008 at 11:00

GoogleCodeExporter commented 9 years ago

Original comment by julien.g...@gmail.com on 12 Oct 2008 at 4:16

GoogleCodeExporter commented 9 years ago
Reopen for fail tests of revision 36.

Original comment by JohnnyJianHY on 13 Oct 2008 at 2:13

GoogleCodeExporter commented 9 years ago
I check out your changes and you've hadded a test that fail. We should have a 
better
way to communicate request for changes. Also the test is clear and I understand
exactly what you think should be tested, we should not have any broken test. We 
could
expect anyone to checkout the code and try to build it. In the meantime I've
commented it.

Original comment by julien.g...@gmail.com on 13 Oct 2008 at 6:54

GoogleCodeExporter commented 9 years ago
I cannot quite follow you. Do you mean that if I have found a bug and write a 
failed 
test for it, then I should comment it before commit?

Original comment by JohnnyJianHY on 13 Oct 2008 at 7:12

GoogleCodeExporter commented 9 years ago
I am not sure commenting a broken test is the best way either, people would see
commented tests and think its OK to comment something that don't pass or they 
don't
like. 

If we have a broken tests for demonstration reason that would mean that someone
working on a different area of the code would have to ignore that test. And if 
they
start ignoring one test they would soon start ignoring any tests. Another 
reason for
not having broken test is Continuous Integration tools, we don't have one, but 
if we
had they would show a broken build all the time.

Hope you see my point. I am open to suggestion but what about submitting a 
patch? Or
hadding the test in a issue comment?

Original comment by julien.g...@gmail.com on 13 Oct 2008 at 7:31

GoogleCodeExporter commented 9 years ago
OK, then let's not commit broken tests but post them in an issue comment.

Original comment by JohnnyJianHY on 13 Oct 2008 at 7:38

GoogleCodeExporter commented 9 years ago
The following test is failed:
    void testNothingExpected() {
        def mockLoader = mock(Loader)
        mockLoader.static

        play {}
    }

Original comment by JohnnyJianHY on 13 Oct 2008 at 7:44

GoogleCodeExporter commented 9 years ago

Original comment by julien.g...@gmail.com on 17 Oct 2008 at 6:03