I have a function defined like this in my controller:

```
def respond_with(action = 0, &block)
  if block_given?
    response = get_response
    block.call( MyResponse.new(response) )
  end
end

```

With that I can query the response object:

```
respond_with do |response|
  case response.status
  when 'ok'
  when 'errors'
   #etc etc...
end

```

I can just call it without the block of course if I want.

If I had a function which returned a value it would be something like

```
controller.should_receive(:respond_with).with(DO_SOMETHING).and_return(something)

```

It would be ok for

```
def respond_with(action = 0)
  ...
  response
end

```

How do I check that the block is called with a specific value in the |response| ?