Groups
Groups
Sign in
Groups
Groups
golang-nuts
Conversations
About
Send feedback
Help
How to tell gomock to ignore arguments?
3,755 views
Skip to first unread message
rvenu...@gmail.com
unread,
Feb 4, 2014, 9:17:39 AM
2/4/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to golan...@googlegroups.com
Hi All
I have a question about
gomock
. How do I make the EXPECT ignore the exact parameters passed.
For e.g., to mock an interface which takes an int and returns a string, I can use
mockObj.EXPECT().SomeMethod(1).Return("This is return value")
However, this is setting the expectation for 1 as the parameters, not any int. I am asking as this is a common enough feature in other programming language tools. For e.g.,
http://rickgaribay.net/archive/2009/06/12/rhino-mocks-ignore-arguments.aspx
Thanks
-Rao
David Symonds
unread,
Feb 4, 2014, 8:47:55 PM
2/4/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rvenu...@gmail.com, golang-nuts
Pass gomock.Any() instead of 1.
rvenu...@gmail.com
unread,
Feb 5, 2014, 3:03:45 AM
2/5/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to golan...@googlegroups.com, rvenu...@gmail.com
Thanks. That worked
Reply all
Reply to author
Forward
0 new messages