From aec4473ff5e4b12992b0c990fd2deab9c2980b2d Mon Sep 17 00:00:00 2001 From: Zhiming Wang Date: Wed, 21 Dec 2016 19:49:09 -0500 Subject: [PATCH] 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 --- Formula/vim.rb | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/Formula/vim.rb b/Formula/vim.rb index f2987217a7..0caa3beb4c 100644 --- a/Formula/vim.rb +++ b/Formula/vim.rb @@ -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