Module: TestProf::RSpecStamp
- Extended by:
- Logging
- Defined in:
- lib/test_prof/rspec_stamp.rb,
lib/test_prof/rspec_stamp/rspec.rb,
lib/test_prof/rspec_stamp/parser.rb
Overview
Mark RSpec examples with provided tags
Defined Under Namespace
Modules: Parser Classes: Configuration, RSpecListener, Stamper
Constant Summary collapse
- EXAMPLE_RXP =
/(\s*)(\w+\s*(?:.*)\s*)(do|{)/.freeze
Constants included from Logging
Class Method Summary collapse
-
.apply_tags(code, lines, tags) ⇒ Object
Accepts source code (as array of lines), line numbers (of example to apply tags) and an array of tags.
- .config ⇒ Object
- .configure {|config| ... } ⇒ Object
Methods included from Logging
Class Method Details
.apply_tags(code, lines, tags) ⇒ Object
Accepts source code (as array of lines), line numbers (of example to apply tags) and an array of tags.
105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/test_prof/rspec_stamp.rb', line 105 def (code, lines, ) failed = 0 lines.each do |line| unless stamp_example(code[line - 1], ) failed += 1 log :warn, "Failed to stamp: #{code[line - 1]}" end end failed end |
.config ⇒ Object
94 95 96 |
# File 'lib/test_prof/rspec_stamp.rb', line 94 def config @config ||= Configuration.new end |
.configure {|config| ... } ⇒ Object
98 99 100 |
# File 'lib/test_prof/rspec_stamp.rb', line 98 def configure yield config end |