vim: fix python test

The previous test doesn't really work. Switch to a new test that
actually attempts to use vim's python capabilities.

Closes #8114.

Signed-off-by: Tomasz Pajor <tomek@polishgeeks.com>
This commit is contained in:
Zhiming Wang 2016-12-21 19:49:09 -05:00 committed by Tomasz Pajor
parent d655a33d8f
commit aec4473ff5

View file

@ -119,18 +119,13 @@ class Vim < Formula
end
test do
# Simple test to check if Vim was linked to Python version in $PATH
if build.with? "python"
vim_path = bin/"vim"
# Get linked framework using otool
otool_output = `otool -L #{vim_path} | grep -m 1 Python`.gsub(/\(.*\)/, "").strip.chomp
# Expand the link and get the python exec path
vim_framework_path = Pathname.new(otool_output).realpath.dirname.to_s.chomp
system_framework_path = `python-config --exec-prefix`.chomp
assert_equal system_framework_path, vim_framework_path
(testpath/"commands.vim").write <<-EOS.undent
:python import vim; vim.current.buffer[0] = 'hello world'
:wq
EOS
system bin/"vim", "-T", "dumb", "-s", "commands.vim", "test.txt"
assert_equal (testpath/"test.txt").read, "hello world\n"
end
end
end