Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Testing Vimscript with Vimrunner
Search
Paul Mucur
February 26, 2013
Programming
3
200
Testing Vimscript with Vimrunner
Presented at Vim London, a look at how to test-drive Vim plugins using the Vimrunner Ruby gem.
Paul Mucur
February 26, 2013
Tweet
Share
More Decks by Paul Mucur
See All by Paul Mucur
Do you really need breakfast?
mudge
0
120
HyperLogLog in 15 minutes
mudge
0
180
Exploring #to_proc
mudge
0
160
Configuration Management with Puppet
mudge
1
220
Extending Ruby with C
mudge
1
280
Managing Web Application Servers with Puppet
mudge
3
140
Other Decks in Programming
See All in Programming
使ってみよう Azure AI Document Intelligence
kosmosebi
2
360
Ruby Function Composition
bkuhlmann
1
340
Ruby Pattern Matching
bkuhlmann
0
930
SwiftUIで使いやすいToastの作り方 / How to build a Toast system which is easy to use in SwiftUI
lovee
3
160
Exploring the Implementation of “t.Run”, “t.Parallel”, and “t.Cleanup”
akarin
1
110
はてなにおける CSS Modules、及び CSS Modules に足りないもの / CSS Modules in Hatena, and CSS Modules missing parts
mizdra
7
970
OpenAPIを中心に考えるAPI開発入門 / Introduction to API Development with a Focus on OpenAPI
seike460
PRO
2
170
PHPはいつから死んでいるかの調査
chiroruxx
2
410
StoreKit2によるiOSのアプリ内課金のリニューアル
kangnux
0
120
PostmanでAPIの動作確認が楽になった話
h455h1
0
180
VS Code をプロダクトにどう取り込むか
onomax
1
640
Tailwind CSSを本気でカスタマイズする方法
fsubal
14
5.5k
Featured
See All Featured
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
3.1k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
123
39k
Six Lessons from altMBA
skipperchong
22
3k
BBQ
matthewcrist
80
8.8k
Scaling GitHub
holman
457
140k
Testing 201, or: Great Expectations
jmmastey
29
6.4k
Become a Pro
speakerdeck
PRO
12
4.6k
Code Review Best Practice
trishagee
56
15k
Building Adaptive Systems
keathley
32
1.9k
Build your cross-platform service in a week with App Engine
jlugia
226
17k
Stop Working from a Prison Cell
hatefulcrawdad
267
19k
The Cost Of JavaScript in 2023
addyosmani
20
3.9k
Transcript
Testing Vimscript with Vimrunner
PAUL MUCUR @mudge
None
Why would I want to test Vimscript?
CAESAR.VIM
None
None
$ vim -‐-‐version VIM -‐ Vi IMproved 7.3 (2010 Aug
15, compiled Feb 16 2013 12:20:10) MacOS X (unix) version Included patches: 1-‐754 Compiled by
[email protected]
Huge version with MacVim GUI. Features included (+) or not (-‐): +arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent +clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments +conceal +cryptv -‐cscope +cursorbind +cursorshape +dialog_con_gui +diff +digraphs +dnd -‐ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path +float +folding -‐footer +fork() +fullscreen -‐gettext -‐hangul_input +iconv +insert_expand +jumplist +keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap -‐lua +menu +mksession +modify_fname +mouse +mouseshape +mouse_dec -‐mouse_gpm -‐mouse_jsbterm +mouse_netterm +mouse_sgr -‐mouse_sysmouse +mouse_urxvt +mouse_xterm +multi_byte +multi_lang -‐mzscheme +netbeans_intg +odbeditor +path_extra +perl +persistent_undo +postscript +printer +profile +python -‐python3 +quickfix +reltime +rightleft +ruby +scrollbind +signs +smartindent -‐sniff +startuptime +statusline -‐sun_workshop +syntax +tag_binary +tag_old_static -‐tag_any_white +tcl +terminfo +termresponse +textobjects +title +toolbar +transparency +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace +wildignore +wildmenu +windows +writebackup -‐X11 -‐xfontset +xim -‐xsmp -‐xterm_clipboard -‐xterm_save
$ vim -‐-‐version VIM -‐ Vi IMproved 7.3 (2010 Aug
15, compiled Feb 16 2013 12:20:10) MacOS X (unix) version Included patches: 1-‐754 Compiled by
[email protected]
Huge version with MacVim GUI. Features included (+) or not (-‐): +arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent +clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments +conceal +cryptv -‐cscope +cursorbind +cursorshape +dialog_con_gui +diff +digraphs +dnd -‐ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path +float +folding -‐footer +fork() +fullscreen -‐gettext -‐hangul_input +iconv +insert_expand +jumplist +keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap -‐lua +menu +mksession +modify_fname +mouse +mouseshape +mouse_dec -‐mouse_gpm -‐mouse_jsbterm +mouse_netterm +mouse_sgr -‐mouse_sysmouse +mouse_urxvt +mouse_xterm +multi_byte +multi_lang -‐mzscheme +netbeans_intg +odbeditor +path_extra +perl +persistent_undo +postscript +printer +profile +python -‐python3 +quickfix +reltime +rightleft +ruby +scrollbind +signs +smartindent -‐sniff +startuptime +statusline -‐sun_workshop +syntax +tag_binary +tag_old_static -‐tag_any_white +tcl +terminfo +termresponse +textobjects +title +toolbar +transparency +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace +wildignore +wildmenu +windows +writebackup -‐X11 -‐xfontset +xim -‐xsmp -‐xterm_clipboard -‐xterm_save
Demonstration of Vim’s client-server functionality
None
vim = Vimrunner.start vim.edit("foo.txt") vim.insert("Hello world!") vim.write
Demonstration of using Vimrunner to remote control Vim from Ruby
describe "caesar.vim" do it "converts 1 to I" do
expect(vim.echo("caesar#ToRoman(1)")).to eq("I") end end
Demonstration of test- driving Vim script with Vimrunner
language: ruby rvm: -‐ 1.9.3 before_install: sudo apt-‐get install
vim-‐gtk before_script: -‐ "export DISPLAY=:99.0" -‐ "sh -‐e /etc/init.d/xvfb start" TRAVIS CI
None
VIM-UNITTEST? VIM-QUICKCHECK? VIM-Your-Test-Library-of-Choice?
Thank you @mudge http://mudge.name