1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/railties/test/mocks/dispatcher.rb

14 lines
359 B
Ruby
Raw Normal View History

class Dispatcher
class <<self
attr_accessor :time_to_sleep
attr_accessor :raise_exception
attr_accessor :dispatch_hook
def dispatch(cgi, session_options = nil, output = $stdout)
dispatch_hook.call(cgi) if dispatch_hook
sleep(time_to_sleep || 0)
raise raise_exception, "Something died" if raise_exception
end
end
end