class MatchFilter
Public Class Methods
new(what, *strings)
click to toggle source
# File lib/mspec/runner/filters/match.rb, line 2 def initialize(what, *strings) @what = what @descriptions = to_regexp(*strings) end
Public Instance Methods
===(string)
click to toggle source
# File lib/mspec/runner/filters/match.rb, line 11 def ===(string) @descriptions.any? { |d| d === string } end
register()
click to toggle source
# File lib/mspec/runner/filters/match.rb, line 15 def register MSpec.register @what, self end
to_regexp(*strings)
click to toggle source
# File lib/mspec/runner/filters/match.rb, line 7 def to_regexp(*strings) strings.map { |str| Regexp.new Regexp.escape(str) } end
unregister()
click to toggle source
# File lib/mspec/runner/filters/match.rb, line 19 def unregister MSpec.unregister @what, self end