Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve required testhelp.rb path. #1096

Merged

Conversation

junaruga
Copy link
Contributor

Last time I sent pull-request to change testhelp.rb path, and it was merged. (73bf56c).
I think it might be my mistake.

Because it looks usual to set "lib" and "test" as a ruby path than "lib" and ".".

Though it may be small thing.

For example, below Rake TestTask is using both "lib" and "test" below page.
http://rake.rubyforge.org/classes/Rake/TestTask.html
t.libs << "test"

Maybe hoe that is used in our Rakefile, its test way is kind of special, because of "lib:bin:test:.". "." is set as a Ruby load path.

bundle exec rake test
...
/usr/local/ruby-2.3.1/bin/ruby -w -Ilib:bin:test:. -e 'require "rubygems"; require "minitest/autorun"; require "test/test_thread_pool.rb"; require "test/test_puma_server.rb"; require "test/test_app_status.rb"; require "test/test_rack_server.rb"; require "test/test_minissl.rb"; require "test/test_tcp_logger.rb"; require "test/test_unix_socket.rb"; require "test/test_tcp_rack.rb"; require "test/test_null_io.rb"; require "test/test_http10.rb"; require "test/test_rack_handler.rb"; require "test/test_persistent.rb"; require "test/test_ws.rb"; require "test/test_puma_server_ssl.rb"; require "test/test_config.rb"; require "test/test_iobuffer.rb"; require "test/test_integration.rb"; require "test/test_cli.rb"; require "test/test_http11.rb"' --

I think that Including "." causes a duplicated path situation.
I am asking hoe community for this point now. (seattlerb/hoe#74)

So, this pull-request's modification looks better than before right now.

Below tests are passed.

$ bundle exec ruby -Ilib:test \
  -r 'rubygems' \
  -r 'minitest/autorun' \
  -e 'Dir.glob "./test/**/test_*.rb", &method(:require)' \
  -- -v
$ bundle exec rake test
$ bundle exec rake test:integration

How do you think?

Thank you.

@evanphx
Copy link
Member

evanphx commented Sep 21, 2016

Ok, that makes sense as requiring relative to the top-level dir, when it's not a normal ruby dir, is a little weird.

@evanphx evanphx merged commit 24b1d20 into puma:master Sep 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants