Test

MATSUMOTO, Ryosuke edited this page May 17, 2014 · 16 revisions
Clone this wiki locally

mod_mruby test use mruby test.

mod_mruby test is very earlier and experimental version. Welcome pull-request!

Add test

Add location config to test/conf/mod_mruby_test.conf
# Apache.echo test
<Location /echo-test>
    mrubyHandlerMiddle __MOD_MRUBY_TEST_DIR__/htdocs/echo.rb
</Location>
Add hook script into test/htdocs/ if you need the script for location config
# test/htdocs/echo.rb
Apache.echo "echo"
Add test code to test/t/mod_mruby.rb
assert('mod_mruby', 'location /echo-test') do
  res = HttpRequest.new.get base + '/echo-test'
  assert_equal "echo\n", res["body"]
end

Testing

Edit httpd, apr, apr-util and configure option in httpd_version
HTTPD_VERSION=httpd-2.4.9                                                        
APR=apr-1.5.1                                                                    
APR_UTIL=apr-util-1.5.3                                                          
HTTPD_CONFIG_OPT=
test.sh create httpd.conf for test, then run test.
sh test.sh