Displaying 2 results from an estimated 2 matches for "mockrequest".
2007 Jul 29
7
Merb test harness
Ezra,
* test harness in new generated merb apps with helpers for testing
merb without starting a server.
* pin down plugin arch
Seems to me that these two tasks go together unless you want to have
rspec built in Merb.
Regarding the test harness, my understanding is that:
- a developer should be able to easily write specs against a merb application.
- a developer should not need to start a merb
2013 Sep 20
3
[PATCH] preload_app can take an optional block for warmup
...preload_app(bool)
- set_bool(:preload_app, bool)
+ #
+ # preload_app can also take an optional block. This block will be invoked
+ # with the rack application and can be used to "warm up" the application
+ # before deployment:
+ #
+ # preload_app do |app|
+ # client = Rack::MockRequest.new(app)
+ # client.get(''/'')
+ # end
+ #
+ def preload_app(bool=nil, &block)
+ if block_given? || bool.respond_to?(:call)
+ set_hook(:preload_app, block_given? ? block : bool, 1)
+ else
+ set_bool(:preload_app, bool)
+ end
end
# Toggles makin...