Commit 9e3a2931 authored by Wandenberg Peixoto's avatar Wandenberg Peixoto

removing explicit references for bundler, and put parameters in tests task

parent e35bed63
require 'bundler'
base_dir = File.expand_path('..', File.dirname(__FILE__)) base_dir = File.expand_path('..', File.dirname(__FILE__))
namespace :docs do namespace :docs do
desc "Generates docs files to preview." desc "Generates docs files to preview."
task :generate do task :generate do
Bundler.require(:docs)
require 'erb' require 'erb'
require 'github/markup' require 'github/markup'
template = ERB.new File.read("#{base_dir}/misc/github_template.html.erb") template = ERB.new File.read("#{base_dir}/misc/github_template.html.erb")
...@@ -23,12 +20,16 @@ namespace :docs do ...@@ -23,12 +20,16 @@ namespace :docs do
end end
desc "Run all tests." desc "Run all tests."
task :tests do task :tests, :executable, :host, :port, :workers do |t, args|
Bundler.setup(:test) ENV['NGINX_EXEC'] = args[:executable] || nil
ENV['NGINX_HOST'] = args[:host] || nil
ENV['NGINX_PORT'] = args[:port] || nil
ENV['NGINX_WORKERS'] = args[:workers] || nil
require 'test/unit' require 'test/unit'
Dir.glob('test_*.rb').each do|f| Dir.glob('test_*.rb').each do|f|
test_case = "#{base_dir}/#{f}".gsub('.rb', '') test_case = "#{base_dir}/test/#{f}".gsub('.rb', '')
require test_case require test_case
end end
end end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment