mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
test_ruby_mode.rb: fix for Emacs 25.1
* test/misc/test_ruby_mode.rb (assert_indent): since write-region in Emacs 25.1 no longer displays the "Wrote file" message, shows the explicit message to check if successfully finished. [ruby-core:77355] [Bug #12785] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1181ecbbd1
commit
967c013391
2 changed files with 11 additions and 2 deletions
|
@ -19,6 +19,9 @@ end
|
|||
class TestRubyMode
|
||||
EVAL_OPT = "--eval"
|
||||
EXPR_SAVE = "(save-buffer 0)"
|
||||
finish_mark = "ok-#{$$}"
|
||||
FINISH_MARK = /^#{finish_mark}$/
|
||||
EXPR_FINISH = "(print \'#{finish_mark})"
|
||||
EXPR_RUBYMODE = "(ruby-mode)"
|
||||
|
||||
def run_emacs(src, *exprs)
|
||||
|
@ -28,6 +31,7 @@ class TestRubyMode
|
|||
exprs = exprs.map {|expr| [EVAL_OPT, expr]}.flatten
|
||||
exprs.unshift(EVAL_OPT, EXPR_RUBYMODE)
|
||||
exprs.push(EVAL_OPT, EXPR_SAVE)
|
||||
exprs.push(EVAL_OPT, EXPR_FINISH)
|
||||
output = IO.popen([*EMACS, tmp.path, *exprs, err:[:child, :out]], "r") {|e| e.read}
|
||||
tmp.open
|
||||
result = tmp.read
|
||||
|
@ -46,7 +50,7 @@ class TestRubyMode
|
|||
source.gsub!(space, '')
|
||||
end
|
||||
result, output = run_emacs(source, EXPR_INDENT)
|
||||
assert_match(/^Wrote /, output)
|
||||
assert_match(FINISH_MARK, output)
|
||||
assert_equal(expected, result, message(*message) {diff expected, result})
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue