On Wed, Mar 5, 2008 at 9:30 AM, Doug Bryant <[EMAIL PROTECTED]> wrote: @policy_service.should_receive(:random_string).with(:no_args).exactly(4).times.and_return(existing_quote_numbers.concat([nil])) > @policy_service.generate_quote_number > end > > ## The result > should not generate a duplicate quote number > Mock 'Service::Base' expected :random_string with (no args) 4 times, but > received it once > > I verified "and_return" is actually returning the array rather than an > individual element of the existing_quote_numbers array which makes sense
You need to splat em out: and_return(*existing_quote_numbers.concat([nil])) Pat _______________________________________________ rspec-users mailing list [email protected] http://rubyforge.org/mailman/listinfo/rspec-users
