diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-03-11 09:33:56 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-03-11 09:33:56 +0000 |
commit | 23f2460e820ad8ec99cf81ff39f3e9adce67b15d (patch) | |
tree | f0bfce76fd2e27c7afcae595ad9f1a8c143a3881 /test/misc | |
parent | bd90dc80f29a09376e04f5f1b6adbe17806a67fa (diff) |
* test/misc/test_ruby_mode.rb (TestRubyMode): try to run emacs if
runnable, and get rid of --quick for older versions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31091 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/misc')
-rw-r--r-- | test/misc/test_ruby_mode.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/test/misc/test_ruby_mode.rb b/test/misc/test_ruby_mode.rb index 06c0a3f6f8..4765b7b7af 100644 --- a/test/misc/test_ruby_mode.rb +++ b/test/misc/test_ruby_mode.rb @@ -1,13 +1,15 @@ require 'test/unit' require 'tempfile' -require 'mkmf' class TestRubyMode < Test::Unit::TestCase MISCDIR = File.expand_path("../../../misc", __FILE__) - if emacs = find_executable0(ENV["EMACS"] || "emacs") - EMACS = %W"#{emacs} --quick --batch --load #{MISCDIR}/ruby-mode.el" - else + emacs = %W"#{ENV["EMACS"] || "emacs"} -q --no-site-file --batch --load #{MISCDIR}/ruby-mode.el" + begin + IO.popen([*emacs, :err=>[:child, :out]]) {|f| f.read} + rescue EMACS = nil + else + EMACS = (emacs if $? and $?.success?) end end |