Re: [rspec-users] [Q] bug in mocks or user error?

2008-03-28 Thread Chuck Remes
On Mar 28, 2008, at 1:46 PM, David Chelimsky wrote: > On Fri, Mar 28, 2008 at 1:38 PM, Chuck Remes > <[EMAIL PROTECTED]> wrote: >> I'm trying to use a mock to return a hash so that #each_pair can >> process it. I can't get it to work. Whatever I return to #each_pair >> is >> ignored and the bl

Re: [rspec-users] [Q] bug in mocks or user error?

2008-03-28 Thread David Chelimsky
On Fri, Mar 28, 2008 at 1:38 PM, Chuck Remes <[EMAIL PROTECTED]> wrote: > I'm trying to use a mock to return a hash so that #each_pair can > process it. I can't get it to work. Whatever I return to #each_pair is > ignored and the block never gets executed. Here's an example > illustrating the pr

Re: [rspec-users] [Q] bug in mocks or user error?

2008-03-28 Thread Chuck Remes
It ends up comparing nil to real_hash. This happens because the #result accessor never gets initialized due to the block never getting executed. cr On Mar 28, 2008, at 12:47 PM, George Anderson wrote: > What's the output (or error?) you're getting? > > /g > > On Fri, Mar 28, 2008 at 1:38 PM,

Re: [rspec-users] [Q] bug in mocks or user error?

2008-03-28 Thread George Anderson
What's the output (or error?) you're getting? /g On Fri, Mar 28, 2008 at 1:38 PM, Chuck Remes <[EMAIL PROTECTED]> wrote: > I'm trying to use a mock to return a hash so that #each_pair can > process it. I can't get it to work. Whatever I return to #each_pair is > ignored and the block never gets

[rspec-users] [Q] bug in mocks or user error?

2008-03-28 Thread Chuck Remes
I'm trying to use a mock to return a hash so that #each_pair can process it. I can't get it to work. Whatever I return to #each_pair is ignored and the block never gets executed. Here's an example illustrating the problem. require File.join(File.dirname(__FILE__), %w[spec_helper]) class MyE