refactor: migrate test suite to Neovim/Lua#171
Merged
Conversation
Replace .tool-versions with mise.toml, pinning to Ruby major version 4 to avoid unexpected breaking changes from future major version bumps.
byebug's native extension fails to compile against Ruby 4's updated C API. Neither gem is referenced in the test suite, so they are safe to remove. Also regenerates Gemfile.lock with current compatible versions.
Document the mise + bundle install workflow so contributors know how to get a working local environment.
Use mise to install Ruby in CI, keeping the toolchain consistent with local development. Removes the hardcoded ruby-version matrix — the version is now sourced from mise.toml. Also bumps actions/checkout to v6.0.2.
Introduces a Lua-based test suite driven by Neovim headless mode and Plenary.nvim, replacing the broken Vimrunner/MacVim client-server setup. - test/minimal_init.lua: bootstraps Plenary from /tmp and loads the plugin - test/helpers.lua: feedkeys, new_buffer, test_bullet_inserted utilities - test/poc_spec.lua: infrastructure smoke tests - test/bullets_spec.lua: first ported spec (basic bullet insertion) - mise.toml: adds `mise run test` task; no Makefile needed
…idoc)
Key learnings captured in test infrastructure:
- feedkeys 'tx' exits insert mode; for non-bullet CR tests use two feedkeys
calls where the second prefixes 'i' to re-enter insert mode
- Non-bullet-line CR is deferred via feedkeys('n') by the plugin; the 'x'
flag drains it within the first call, leaving normal mode on the new line
- vim.wait() exits insert mode — do not use it between feedkeys calls
- startinsert! is not synchronous from Lua — cannot bridge feedkeys calls
- set formatoptions= + comments= in minimal_init and per-test to prevent
Neovim's '#' comment-continuation from corrupting test buffers
- nested dot bullet test (asciidoc) passes in Neovim — pending mark removed
…ckboxes) Additional learnings added to minimal_init.lua: - set noexpandtab globally to prevent user config leaking \t → spaces - new_buffer() positions cursor at last line, so tests navigating from line 1 must prefix 'gg' before their first motion - expandtab contamination affects <C-t> indent tests; fixed globally
Completes full test suite migration — all 63 tests passing. Additional learnings: - set expandtab=false + shiftwidth/tabstop=4 in before_each for indent tests - visual mode selection is re-entered by plugin after </> ops; subsequent operations stay in visual — no <Esc> needed between chained motions - A<CR><CR> in one feedkeys call handles the empty-bullet deletion case (both CRs fire while in insert mode, second deletes the empty bullet) - .strip in Ruby tests hides trailing "- " (with space); Lua tests assert the actual content including the trailing space - mid-test config changes (e.g. g:bullets_enable_roman_list) work by setting the global between separate feedkeys calls
* master: chore: migrate to mise (#170)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--servernameclient-server protocol, broken on macOS 16 with MacVim 9.2) with a headless Neovim + Lua + Plenary stackmise run testis the single command to run the suitejdx/mise-action@v4.0.1and pins Ruby to major version 4Changes
mise.toml: addsmise run testtask; pins Ruby to4; drops.tool-versionsGemfile/Gemfile.lock: removespry/pry-byebug(incompatible with Ruby 4 native ext).github/workflows/test.yml: replacesruby/setup-ruby+xvfb-run rspecwithjdx/mise-action+nvim --headlesstest/minimal_init.lua: bootstraps Plenary from/tmp, loads plugin, sets test-safe defaults (noexpandtab,formatoptions=)test/helpers.lua:feedkeys,new_buffer,get_lines,test_bullet_inserted,reset_configtest/*_spec.lua: full Lua test suite (9 spec files)README.md: adds local development setup sectionKey learnings from the migration
feedkeys('tx')exits insert mode after draining typeahead — for non-bullet-line CR tests, use two calls withiprefix on the second<CR>viafeedkeys("\<CR>", 'n')on non-bullet lines; thexflag drains this within the same outer callvim.wait()exits insert mode — never use it between feedkeys callsnoexpandtabandformatoptions=must be set globally or tests contaminate each otherpendingin Ruby now passes in Neovim (was a Vimrunner-specific issue)Test plan
mise run test— 63/63 passing locallySpeed
⚡ blazing fast!
