Class: RSpec::Risky::StaticDetector
- Inherits:
-
Object
- Object
- RSpec::Risky::StaticDetector
- Defined in:
- lib/rspec/risky/static_detector.rb,
sig/rspec/risky.rbs
Defined Under Namespace
Classes: Finding
Constant Summary collapse
- ASSERTION_METHODS =
%w[assert expect refute].freeze
- OUTPUT_METHODS =
%w[p print printf puts warn].freeze
- TEST_METHODS =
%w[it scenario specify test].freeze
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(paths) ⇒ StaticDetector
constructor
A new instance of StaticDetector.
- #scan ⇒ Object
Constructor Details
#initialize(paths) ⇒ StaticDetector
Returns a new instance of StaticDetector.
28 29 30 |
# File 'lib/rspec/risky/static_detector.rb', line 28 def initialize(paths) @paths = Array(paths).flat_map { |path| (path) } end |
Class Method Details
.scan(paths) ⇒ Array[untyped]
24 25 26 |
# File 'lib/rspec/risky/static_detector.rb', line 24 def self.scan(paths) new(paths).scan end |
Instance Method Details
#scan ⇒ Object
32 33 34 |
# File 'lib/rspec/risky/static_detector.rb', line 32 def scan @paths.flat_map { |path| scan_file(path) } end |