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
Constant Summary collapse
- EXAMPLE_RXP =
/(\s*)(\w+\s*(?:.*)\s*)(do|{)/
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.
61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/test_prof/rspec_stamp.rb', line 61 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
50 51 52 |
# File 'lib/test_prof/rspec_stamp.rb', line 50 def config @config ||= Configuration.new end |
.configure {|config| ... } ⇒ Object
54 55 56 |
# File 'lib/test_prof/rspec_stamp.rb', line 54 def configure yield config end |