switch rspec to function with default