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

Only describe, it, context, specify, feature and scenario can be focused #13

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions exemples/focus_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
describe "Something" do
# can focus describe

before do
# cannot focus here
end

# can focus context

it "can focus" do
# can focus it

expect do
# cannot focus here
end
end

specify "some specification" do
# can focus specify
#
expect do
# cannot focus here
end
end

context "some context" do
# can focus context

before do
# cannot focus here
end

# can focus context

expect do
# cannot focus here
end
end
end


feature "some feature" do
# can focus feature

before do
# cannot focus here
end

# can focus feature

scenario "some scenario" do
# can focus some scenario

expect do
# cannot focus here
end
end
end

2 changes: 1 addition & 1 deletion ftplugin/ruby.vim
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function! s:Preserve(command)
endfunction

function! s:AddFocusTag()
call s:Preserve("normal! ? do\<cr>C, :focus do\<esc>")
call s:Preserve("normal! ?\\(describe\\|it\\|context\\|scenario\\|feature\\|specify\\)\\s\\+['\"].*['\"]\\s\\+do\<cr>$bhi, :focus\<esc>")
endfunction

function! s:RemoveAllFocusTags()
Expand Down