Kristian Mandrup wrote:
What are the options for creating specs for file operations, executing
commands in the CLI etc.?
If I build a generator or something which runs a lot of things in the
command line, how do I check the results of these operations, fx
mocking file system updates and/or mocki
Oh yes, forgot to add that, if you do self.current_user = user, it will call
your mock as expected.
Sorry for the multitude of emails.
2010/6/7 Vinícius Baggio Fuentes
> If current_user is an instance variable (as if you did attr_accessor
> :current_user), you should try:
> @current_user = @us
If current_user is an instance variable (as if you did attr_accessor
:current_user), you should try:
@current_user = @user
If not, you should try invoking with self:
self.current_user = @user
because ruby is creating a local variable named current_user instead of
invoking #current_user=. When you
Hello,
This could be rephrased as -- How to test calls of special assigment
(setter) methods?
I am trying to test the assigmnet of a user object to the
current_user=(new_user) method. It is part of an authentication process and
finally the object is assigned to the session through this method. I
On 7 Jun 2010, at 16:52, Ben Butler-Cole wrote:
> On 7 June 2010 16:34, Matt Wynne wrote:
>
> I'm still not quite clear what you're trying to achieve. Do you want to
> assert that a specific block is passed to the collaborator, or do you want to
> assert that any old block with a particular b
On 7 June 2010 16:34, Matt Wynne wrote:
I'm still not quite clear what you're trying to achieve. Do you want to
> assert that a specific block is passed to the collaborator, or do you want
> to assert that any old block with a particular behaviour is passed to the
> collaborator?
>
> If it's the
On 7 Jun 2010, at 15:56, Ben Butler-Cole wrote:
> On 7 June 2010 15:25, Matt Wynne wrote:
>
> Have you seen and_yield? I can't quite get my head around what you're trying
> to do, but it might help anyway
>
> Thank you, I have. My understanding is that #and_yield has much the same use
> as #
On 7 June 2010 15:25, Matt Wynne wrote:
Have you seen and_yield? I can't quite get my head around what you're trying
> to do, but it might help anyway
>
Thank you, I have. My understanding is that #and_yield has much the same use
as #and_return (in its non-bastardized-by-me-form). That is, you s
On 7 Jun 2010, at 15:13, Ben Butler-Cole wrote:
> Hello.
>
> I'm trying to use RSpec's mocks to describe code which passes a block to a
> collaborator. I want to write an assertion against the value returned by the
> block. I can't find any explicit support for this in RSpec, but perhaps I
>
Hello.
I'm trying to use RSpec's mocks to describe code which passes a block to a
collaborator. I want to write an assertion against the value returned by the
block. I can't find any explicit support for this in RSpec, but perhaps I
have missed something.
I have come up with a hack which almost d
10 matches
Mail list logo