[rspec-users] as_null_object

rhydiant
Thu, 27 May 2010 03:01:26 -0000

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(:foo).as_null_object

I think this would be cleaner, what do you think?