Skip to content

Commit

Permalink
fix: test helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcuts committed Dec 29, 2022
1 parent 97b16e0 commit d65dd73
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 2 deletions.
45 changes: 45 additions & 0 deletions doc/neovim-plugin-boilerplate.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
==============================================================================
------------------------------------------------------------------------------
*YourPluginName.options*
`YourPluginName.options`
Your plugin configuration with its default values.

Default values:
>
YourPluginName.options = {
-- Prints useful logs about what event are triggered, and reasons actions are executed.
debug = false,
}
<

------------------------------------------------------------------------------
*YourPluginName.setup()*
`YourPluginName.setup`({options})
Define your your-plugin-name setup.

Parameters~
{options} `(table)` Module config table. See |YourPluginName.options|.

Usage~
`require("your-plugin-name").setup()` (add `{}` with your |YourPluginName.options| table)


==============================================================================
------------------------------------------------------------------------------
*YourPluginName.toggle()*
`YourPluginName.toggle`()
Toggle the plugin by calling the `enable`/`disable` methods respectively.

------------------------------------------------------------------------------
*YourPluginName.enable()*
`YourPluginName.enable`()
A method to enable your plugin.

------------------------------------------------------------------------------
*YourPluginName.disable()*
`YourPluginName.disable`()
A method to disable your plugin.


vim:tw=78:ts=8:noet:ft=help:norl:
5 changes: 5 additions & 0 deletions doc/tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
YourPluginName.disable() neovim-plugin-boilerplate.txt /*YourPluginName.disable()*
YourPluginName.enable() neovim-plugin-boilerplate.txt /*YourPluginName.enable()*
YourPluginName.options neovim-plugin-boilerplate.txt /*YourPluginName.options*
YourPluginName.setup() neovim-plugin-boilerplate.txt /*YourPluginName.setup()*
YourPluginName.toggle() neovim-plugin-boilerplate.txt /*YourPluginName.toggle()*
8 changes: 6 additions & 2 deletions tests/helpers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,13 @@ Helpers.expect.config_equality = MiniTest.new_expectation(
-- Check type equality of a config `field` against `value` in the given `child` process.
-- @usage config_type_equality(child, "debug", "boolean")
Helpers.expect.config_type_equality = MiniTest.new_expectation(
"config option matches",
"config option type matches",
function(child, field, value)
return Helpers.expect.global_equality(child, "_G.YourPluginName.config." .. field, value)
return Helpers.expect.global_equality(
child,
"type(_G.YourPluginName.config." .. field .. ")",
value
)
end,
errorMessage
)
Expand Down

0 comments on commit d65dd73

Please sign in to comment.