A plugin for central tracking of open nvim listen sockets
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add tests for core functionality using plenary

rektide ee2dcb47 908b982f

+204 -2
+2 -2
.beads/issues.jsonl
··· 4 4 {"id":"nvim-registry-5aj","title":"Implement registry.lua - Main registry module","description":"Create the main registry module that coordinates all functionality. Export public API for plugin usage. Manage the overall state and orchestrate between other modules.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-08T18:25:45.045869094-05:00","created_by":"rektide","updated_at":"2026-01-08T18:35:35.73023499-05:00","closed_at":"2026-01-08T18:35:35.73023499-05:00","close_reason":"Closed via update"} 5 5 {"id":"nvim-registry-atn","title":"Implement cleanup.lua - Async socket validation","description":"Create cleanup.lua with async functionality using plenary.nvim. Check stats for all sockets in listen-registery using async operations. Perform batch update to remove invalid sockets after all stats are gathered. Expose :RegistryCleanup command.","status":"closed","priority":2,"issue_type":"feature","created_at":"2026-01-08T18:25:46.936796595-05:00","created_by":"rektide","updated_at":"2026-01-08T18:36:32.278258028-05:00","closed_at":"2026-01-08T18:36:32.278258028-05:00","close_reason":"Closed via update"} 6 6 {"id":"nvim-registry-cst","title":"Implement health.lua - Neovim healthcheck","description":"Create health.lua that provides healthcheck diagnostics. Check neoconf availability, plenary availability, and registry status. Report on any issues or misconfigurations.","status":"closed","priority":3,"issue_type":"task","created_at":"2026-01-08T18:25:47.889265985-05:00","created_by":"rektide","updated_at":"2026-01-08T18:37:31.359142755-05:00","closed_at":"2026-01-08T18:37:31.359142755-05:00","close_reason":"Closed via update"} 7 - {"id":"nvim-registry-gxz","title":"Create example configuration and usage examples","description":"Add example configuration to README. Create usage examples in documentation. Show how to use the plugin manually and in automated workflows. Document the expected behavior.","status":"in_progress","priority":4,"issue_type":"chore","created_at":"2026-01-08T18:25:56.569158454-05:00","created_by":"rektide","updated_at":"2026-01-08T18:39:22.140747623-05:00"} 7 + {"id":"nvim-registry-gxz","title":"Create example configuration and usage examples","description":"Add example configuration to README. Create usage examples in documentation. Show how to use the plugin manually and in automated workflows. Document the expected behavior.","status":"closed","priority":4,"issue_type":"chore","created_at":"2026-01-08T18:25:56.569158454-05:00","created_by":"rektide","updated_at":"2026-01-08T18:40:01.1203033-05:00","closed_at":"2026-01-08T18:40:01.1203033-05:00","close_reason":"Closed via update"} 8 8 {"id":"nvim-registry-iwa","title":"Extra Features for registry-nvim","description":"Epic for additional features beyond the core functionality. Includes CLI tools, integration utilities, and enhanced workflow capabilities.","status":"open","priority":4,"issue_type":"epic","created_at":"2026-01-08T18:30:35.840964917-05:00","created_by":"rektide","updated_at":"2026-01-08T18:30:35.840964917-05:00"} 9 9 {"id":"nvim-registry-x9n","title":"Implement config.lua - Configuration management","description":"Create config.lua module to handle neoconf integration. Manage the listen-registery property in global settings. Provide functions to get and update the registry list.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-08T18:25:44.226867025-05:00","created_by":"rektide","updated_at":"2026-01-08T18:34:59.326163455-05:00","closed_at":"2026-01-08T18:34:59.326163455-05:00","close_reason":"Closed via update"} 10 - {"id":"nvim-registry-yjo","title":"Add tests for core functionality","description":"Create tests for registry, config, monitor, and cleanup modules. Use plenary's test framework or vitest. Test async operations and neoconf integration.","status":"open","priority":4,"issue_type":"task","created_at":"2026-01-08T18:25:50.169339092-05:00","created_by":"rektide","updated_at":"2026-01-08T18:25:50.169339092-05:00"} 10 + {"id":"nvim-registry-yjo","title":"Add tests for core functionality","description":"Create tests for registry, config, monitor, and cleanup modules. Use plenary's test framework or vitest. Test async operations and neoconf integration.","status":"in_progress","priority":4,"issue_type":"task","created_at":"2026-01-08T18:25:50.169339092-05:00","created_by":"rektide","updated_at":"2026-01-08T18:40:04.683125217-05:00"} 11 11 {"id":"nvim-registry-zby","title":"Create project structure and plugin manifest","description":"Create the basic plugin structure including lua/ directory, plugin manifest file, and initialize the package.json for npm packaging if needed. Set up the modular file layout.","status":"closed","priority":1,"issue_type":"task","created_at":"2026-01-08T18:25:43.695223932-05:00","created_by":"rektide","updated_at":"2026-01-08T18:34:26.74401299-05:00","closed_at":"2026-01-08T18:34:26.74401299-05:00","close_reason":"Closed via update"} 12 12 {"id":"nvim-registry-zcr","title":"Implement monitor.lua - Listen server discovery","description":"Create monitor.lua to detect and track listen servers. Use autocmds or polling to discover new listen sockets. Update the neoconf registry when new servers are found.","status":"closed","priority":2,"issue_type":"feature","created_at":"2026-01-08T18:25:45.935166254-05:00","created_by":"rektide","updated_at":"2026-01-08T18:35:57.649714628-05:00","closed_at":"2026-01-08T18:35:57.649714628-05:00","close_reason":"Closed via update"}
+38
tests/cleanup_spec.lua
··· 1 + describe("registry-nvim.cleanup", function() 2 + local cleanup = require("registry-nvim.cleanup") 3 + 4 + it("should have cleanup_registry function", function() 5 + assert.is_not_nil(cleanup.cleanup_registry) 6 + assert.is_function(cleanup.cleanup_registry) 7 + end) 8 + 9 + it("should have check_socket_valid function", function() 10 + assert.is_not_nil(cleanup.check_socket_valid) 11 + assert.is_function(cleanup.check_socket_valid) 12 + end) 13 + 14 + it("should return false for empty socket", function() 15 + local valid = cleanup.check_socket_valid("") 16 + assert.is_false(valid) 17 + end) 18 + 19 + it("should return false for nil socket", function() 20 + local valid = cleanup.check_socket_valid(nil) 21 + assert.is_false(valid) 22 + end) 23 + 24 + it("should return boolean for valid socket check", function() 25 + local valid = cleanup.check_socket_valid("/tmp/nonexistent.sock") 26 + assert.is_boolean(valid) 27 + end) 28 + 29 + it("should return boolean from cleanup_registry", function() 30 + local result = cleanup.cleanup_registry() 31 + assert.is_boolean(result) 32 + end) 33 + 34 + it("should reject non-existent socket", function() 35 + local valid = cleanup.check_socket_valid("/tmp/definitely-not-a-socket-12345.sock") 36 + assert.is_false(valid) 37 + end) 38 + end)
+39
tests/config_spec.lua
··· 1 + describe("registry-nvim.config", function() 2 + local config = require("registry-nvim.config") 3 + 4 + it("should have a registry key", function() 5 + local key = config.get_registry_key() 6 + assert.equals("listen_registery", key) 7 + end) 8 + 9 + it("should return config object", function() 10 + local cfg = config.get_config() 11 + assert.is_not_nil(cfg) 12 + assert.equals("listen_registery", cfg.listen_registry_key) 13 + end) 14 + 15 + it("should have get_registry function", function() 16 + assert.is_not_nil(config.get_registry) 17 + assert.is_function(config.get_registry) 18 + end) 19 + 20 + it("should have add_to_registry function", function() 21 + assert.is_not_nil(config.add_to_registry) 22 + assert.is_function(config.add_to_registry) 23 + end) 24 + 25 + it("should have remove_from_registry function", function() 26 + assert.is_not_nil(config.remove_from_registry) 27 + assert.is_function(config.remove_from_registry) 28 + end) 29 + 30 + it("should have update_registry function", function() 31 + assert.is_not_nil(config.update_registry) 32 + assert.is_function(config.update_registry) 33 + end) 34 + 35 + it("should have has_neoconf function", function() 36 + assert.is_not_nil(config.has_neoconf) 37 + assert.is_function(config.has_neoconf) 38 + end) 39 + end)
+37
tests/monitor_spec.lua
··· 1 + describe("registry-nvim.monitor", function() 2 + local monitor = require("registry-nvim.monitor") 3 + 4 + it("should have get_current_server_socket function", function() 5 + assert.is_not_nil(monitor.get_current_server_socket) 6 + assert.is_function(monitor.get_current_server_socket) 7 + end) 8 + 9 + it("should have register_current_server function", function() 10 + assert.is_not_nil(monitor.register_current_server) 11 + assert.is_function(monitor.register_current_server) 12 + end) 13 + 14 + it("should have init function", function() 15 + assert.is_not_nil(monitor.init) 16 + assert.is_function(monitor.init) 17 + end) 18 + 19 + it("should have start function", function() 20 + assert.is_not_nil(monitor.start) 21 + assert.is_function(monitor.start) 22 + end) 23 + 24 + it("should have stop function", function() 25 + assert.is_not_nil(monitor.stop) 26 + assert.is_function(monitor.stop) 27 + end) 28 + 29 + it("should return string or nil from get_current_server_socket", function() 30 + local socket = monitor.get_current_server_socket() 31 + if socket then 32 + assert.is_string(socket) 33 + else 34 + assert.is_nil(socket) 35 + end 36 + end) 37 + end)
+88
tests/registry_spec.lua
··· 1 + describe("registry-nvim.registry", function() 2 + local registry = require("registry-nvim.registry") 3 + 4 + it("should have get_all function", function() 5 + assert.is_not_nil(registry.get_all) 6 + assert.is_function(registry.get_all) 7 + end) 8 + 9 + it("should have add function", function() 10 + assert.is_not_nil(registry.add) 11 + assert.is_function(registry.add) 12 + end) 13 + 14 + it("should have remove function", function() 15 + assert.is_not_nil(registry.remove) 16 + assert.is_function(registry.remove) 17 + end) 18 + 19 + it("should have update function", function() 20 + assert.is_not_nil(registry.update) 21 + assert.is_function(registry.update) 22 + end) 23 + 24 + it("should have count function", function() 25 + assert.is_not_nil(registry.count) 26 + assert.is_function(registry.count) 27 + end) 28 + 29 + it("should have clear function", function() 30 + assert.is_not_nil(registry.clear) 31 + assert.is_function(registry.clear) 32 + end) 33 + 34 + it("should have contains function", function() 35 + assert.is_not_nil(registry.contains) 36 + assert.is_function(registry.contains) 37 + end) 38 + 39 + it("should return a table from get_all", function() 40 + local all = registry.get_all() 41 + assert.is_table(all) 42 + end) 43 + 44 + it("should return a number from count", function() 45 + local count = registry.count() 46 + assert.is_number(count) 47 + end) 48 + 49 + it("should return boolean from contains", function() 50 + local contains = registry.contains("/tmp/test.sock") 51 + assert.is_boolean(contains) 52 + end) 53 + 54 + it("should reject empty socket for add", function() 55 + local result = registry.add("") 56 + assert.is_false(result) 57 + end) 58 + 59 + it("should reject nil socket for add", function() 60 + local result = registry.add(nil) 61 + assert.is_false(result) 62 + end) 63 + 64 + it("should reject empty socket for remove", function() 65 + local result = registry.remove("") 66 + assert.is_false(result) 67 + end) 68 + 69 + it("should reject nil socket for remove", function() 70 + local result = registry.remove(nil) 71 + assert.is_false(result) 72 + end) 73 + 74 + it("should reject non-table update", function() 75 + local result = registry.update("not a table") 76 + assert.is_false(result) 77 + end) 78 + 79 + it("should reject nil update", function() 80 + local result = registry.update(nil) 81 + assert.is_false(result) 82 + end) 83 + 84 + it("should return boolean from clear", function() 85 + local result = registry.clear() 86 + assert.is_boolean(result) 87 + end) 88 + end)