aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/mocks/dispatcher.rb
blob: 9ca6b609c6c3a8ce986a19036ae7741caba03017 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
class Dispatcher
  class <<self
    attr_accessor :time_to_sleep
    attr_accessor :raise_exception

    def dispatch(cgi)
      sleep(time_to_sleep || 0)
      raise raise_exception, "Something died" if raise_exception
    end
  end
end