[Groonga-commit] ranguba/groonga-client-rails at d543436 [master] test: use bundle exec

Back to archive index

Kouhei Sutou null+****@clear*****
Sun Mar 27 17:11:10 JST 2016


Kouhei Sutou	2016-03-27 17:11:10 +0900 (Sun, 27 Mar 2016)

  New Revision: d543436207682d891eda2dcf6cf2ddf84cd348c6
  https://github.com/ranguba/groonga-client-rails/commit/d543436207682d891eda2dcf6cf2ddf84cd348c6

  Message:
    test: use bundle exec

  Modified files:
    test/run-test.rb

  Modified: test/run-test.rb (+11 -2)
===================================================================
--- test/run-test.rb    2016-03-27 17:01:38 +0900 (3dcd422)
+++ test/run-test.rb    2016-03-27 17:11:10 +0900 (f1a85f8)
@@ -22,6 +22,10 @@ unless system(RbConfig.ruby, "test/unit/run-test.rb", *ARGV)
   exit(false)
 end
 
+def bundlered?
+  not ENV["BUNDLE_GEMFILE"].nil?
+end
+
 def unbundler
   ENV["BUNDLE_GEMFILE"] = nil
   ENV["GEM_HOME"] = nil
@@ -29,11 +33,16 @@ def unbundler
   ENV["RUBYOPT"]  = nil
 end
 
-unbundler
+if bundlered?
+  unbundler
+  command_line = ["bundle", "exec"]
+else
+  command_line = [RbConfig.ruby]
+end
 
 Dir.glob("#{__dir__}/apps/*") do |test_application|
   Dir.chdir(test_application) do
-    unless system(RbConfig.ruby, "-S", "bin/rake",
+    unless system(*command_line, "bin/rake",
                   "test", "TESTOPTS=#{ARGV.join(' ')}")
       exit(false)
     end
-------------- next part --------------
HTML����������������������������...
下载 



More information about the Groonga-commit mailing list
Back to archive index