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.
106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/test_prof/rspec_stamp.rb', line 106 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
95 96 97 |
# File 'lib/test_prof/rspec_stamp.rb', line 95 def config @config ||= Configuration.new end |
.configure {|config| ... } ⇒ Object
99 100 101 |
# File 'lib/test_prof/rspec_stamp.rb', line 99 def configure yield config end |