Class: PreCommit::Checks::RspecFocus
- Inherits:
-
Grep
show all
- Defined in:
- lib/plugins/pre_commit/checks/rspec_focus.rb
Instance Attribute Summary
Attributes inherited from Plugin
#config, #pluginator
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Grep
#call, #extra_grep, #initialize
Methods inherited from Plugin
#initialize, #name
Class Method Details
.description ⇒ Object
23
24
25
|
# File 'lib/plugins/pre_commit/checks/rspec_focus.rb', line 23
def self.description
"Finds ruby specs that are focused."
end
|
Instance Method Details
19
20
21
|
# File 'lib/plugins/pre_commit/checks/rspec_focus.rb', line 19
def
"(fdescribe|fcontext|fit).*(\"|').*(\"|').*do"
end
|
#files_filter(staged_files) ⇒ Object
7
8
9
|
# File 'lib/plugins/pre_commit/checks/rspec_focus.rb', line 7
def files_filter(staged_files)
staged_files.grep(/_spec\.rb$/)
end
|
#message ⇒ Object
11
12
13
|
# File 'lib/plugins/pre_commit/checks/rspec_focus.rb', line 11
def message
"focus found in specs:"
end
|
#pattern ⇒ Object
15
16
17
|
# File 'lib/plugins/pre_commit/checks/rspec_focus.rb', line 15
def pattern
"(describe|context|it).*(:focus|focus:).*do"
end
|