[jira] Created: (JMOCK-207) Statically type-safe way of defining expectations for all mock objects of a given type

View: New views
1 Messages — Rating Filter:   Alert me  

[jira] Created: (JMOCK-207) Statically type-safe way of defining expectations for all mock objects of a given type

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Statically type-safe way of defining expectations for all mock objects of a given type
--------------------------------------------------------------------------------------

                 Key: JMOCK-207
                 URL: http://jira.codehaus.org/browse/JMOCK-207
             Project: jMock
          Issue Type: New Feature
          Components: Library
    Affects Versions: 2.5.1
            Reporter: Nat Pryce
            Priority: Minor


From http://starobjects.blogspot.com/2008/11/jmock-actions-api.html

"It would be nice is if the:

"allowing(any(Injectable.class))

returned an reference of type Injectable. As it is, the use of method("injectInto") is a little fragile if I were to refactor the name."

That exact syntax would not be possible, but we could do:

allowing(Foo.class).bar();

That is, pass a class to mean "all instances of this class".  It will return an imposteriser to capture the method call.


--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email