Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add function for testing context #93

Merged
merged 1 commit into from
Jan 26, 2018
Merged

Add function for testing context #93

merged 1 commit into from
Jan 26, 2018

Conversation

dewyze
Copy link
Contributor

@dewyze dewyze commented Jan 24, 2018

What

Add the ability to run \rc to run tests for a context.

Why

The move to vim-test would remove the ability to run a test for a
context, this adds that back in. If run on a line that is a context
block, it will run that context as per the previous behavior.

Technical Details

The regexes used here are based on the ones used in vim-ruby to find
nested 'class/module/do' + end blocks and navigate them properly. This
will find each parent block until it finds a test context or cannot find
a new parent.

Additionally, the wall function was moved inside the function because
on blank lines the <CR> would move down a line and that would change
the behavior.

The move to vim-test would remove the ability to run a test for a
context, this adds that back in. If run on a line that is a context
block, it will run that context as per the previous behavior.

The regexes used here are based on the ones used in `vim-ruby` to find
nested 'class/module/do' + end blocks and navigate them properly. This
will find each parent block until it finds a test context or cannot find
a new parent.

Additionally, the `wall` function was moved inside the function because
on blank lines the `<CR>` would move down a line and that would change
the behavior.
@pgr0ss pgr0ss merged commit 05a502f into braintreeps:vim_test Jan 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants