aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/mocks
diff options
context:
space:
mode:
Diffstat (limited to 'railties/test/mocks')
-rw-r--r--railties/test/mocks/dispatcher.rb11
-rw-r--r--railties/test/mocks/fcgi.rb12
2 files changed, 23 insertions, 0 deletions
diff --git a/railties/test/mocks/dispatcher.rb b/railties/test/mocks/dispatcher.rb
new file mode 100644
index 0000000000..9ca6b609c6
--- /dev/null
+++ b/railties/test/mocks/dispatcher.rb
@@ -0,0 +1,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
diff --git a/railties/test/mocks/fcgi.rb b/railties/test/mocks/fcgi.rb
new file mode 100644
index 0000000000..071b8e1848
--- /dev/null
+++ b/railties/test/mocks/fcgi.rb
@@ -0,0 +1,12 @@
+class FCGI
+ class << self
+ attr_accessor :time_to_sleep
+ attr_accessor :raise_exception
+
+ def each_cgi
+ sleep(time_to_sleep || 0)
+ raise raise_exception, "Something died" if raise_exception
+ yield "mock cgi value"
+ end
+ end
+end