Re: [rspec-users] as_null_object

2010-05-26 Thread rhydiant
Makes sense... So would you tend to use double() in place of mock()/ stub()? On May 27, 1:22 pm, David Chelimsky wrote: > On May 26, 2010, at 10:01 PM, rhydiant wrote: > > > Given that RSpec has the following methods to create test doubles ... > > >  double(:my_t

[rspec-users] as_null_object

2010-05-26 Thread rhydiant
Given that RSpec has the following methods to create test doubles ... double(:my_test_double) mock(:my_mock_object) stub(:my_stub) Is there a way to/ plans to introduce a similar syntax for null objects? null_object(:my_null_object) Instead of mock(:bar, :is_null_object => true) or mock

Re: [rspec-users] Stubbing return arguments

2010-05-16 Thread rhydiant
Thanks for the reply David, works a treat. I'll probably end up refacting away from that design but right now that's exactly what I need. Regards Rhydian On May 17, 9:10 am, David Chelimsky wrote: > On May 15, 2010, at 2:56 AM, rhydiant wrote: > > > > > I'

[rspec-users] Stubbing return arguments

2010-05-16 Thread rhydiant
I'm writting a code example for the following method: def upload(email_address, product_data) errors = [] user = resolve_user_from(email_address) product_file_name = ProductFileHandler.persist(user, product_data, errors) if errors.blank? # ... do some stuff