James Mead
2007-Sep-11 14:10 UTC
[mocha-developer] Fwd: [ mocha-Feature Requests-13763 ] add with_any_arguments method
---------- Forwarded message ----------
From: noreply at rubyforge.org <noreply at rubyforge.org>
Date: 7 Sep 2007 22:43
Subject: [ mocha-Feature Requests-13763 ] add with_any_arguments method
To: noreply at rubyforge.org
Feature Requests item #13763, was opened at 2007-09-07 17:43
You can respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=7480&aid=13763&group_id=1917
Category: None
Group: None
Status: Open
Priority: 3
Submitted By: Luke Melia (lukemelia)
Assigned to: Nobody (None)
Summary: add with_any_arguments method
Initial Comment:
We''ve found this useful when we don''t care about the arguments
passed to a
method. It would be great for it to find it''s way into mocha.
module Mocha
class Expectation
def with_any_arguments()
with(){ true }
end
end
end
Cheers from NYC,
Luke
----------------------------------------------------------------------
You can respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=7480&aid=13763&group_id=1917
--
James.
http://blog.floehopper.org
http://tumble.floehopper.org
James Mead
2007-Sep-11 14:11 UTC
[mocha-developer] Fwd: [ mocha-Feature Requests-13763 ] add with_any_arguments method
---------- Forwarded message ----------
From: noreply at rubyforge.org <noreply at rubyforge.org>
Date: 11 Sep 2007 15:09
Subject: [ mocha-Feature Requests-13763 ] add with_any_arguments method
To: noreply at rubyforge.org
Feature Requests item #13763, was opened at 2007-09-07 21:43
You can respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=7480&aid=13763&group_id=1917
Category: None
Group: None
Status: Open
Priority: 3
Submitted By: Luke Melia (lukemelia)
Assigned to: Nobody (None)
Summary: add with_any_arguments method
Initial Comment:
We''ve found this useful when we don''t care about the arguments
passed to a
method. It would be great for it to find it''s way into mocha.
module Mocha
class Expectation
def with_any_arguments()
with(){ true }
end
end
end
Cheers from NYC,
Luke
----------------------------------------------------------------------
>Comment By: James Mead (jamesmead)
Date: 2007-09-11 14:09
Message:
Hi Luke,
Thanks for your interest in Mocha. I think the behaviour you are looking for
is the default behaviour for an expectation without a call to the
Expectation#with method, so all of the following tests should pass...
def test_with_no_arguments
weeble = mock(''weeble'')
weeble.expects(:wobble)
weeble.wobble
end
def test_with_one_argument
weeble = mock(''weeble'')
weeble.expects(:wobble)
weeble.wobble(1)
end
def test_with_two_arguments
weeble = mock(''weeble'')
weeble.expects(:wobble)
weeble.wobble(1, 2)
end
def test_with_three_arguments
weeble = mock(''weeble'')
weeble.expects(:wobble)
weeble.wobble(1, 2, 3)
end
Let me know if this is not what you meant...
Cheers, James.
----------------------------------------------------------------------
You can respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=7480&aid=13763&group_id=1917
--
James.
http://blog.floehopper.org
http://tumble.floehopper.org
Seemingly Similar Threads
- SIP REGISTER behavior change: specific domains possible in REGISTER
- Fwd: [ mocha-Feature Requests-15021 ] without or not params matcher
- Fwd: [ mocha-Feature Requests-5856 ] Stubbing of private methods should be allowed
- Fwd: [ mocha-Feature Requests-7119 ] ability to specify call order
- [Cucumber] Progress Bar