Class: TextChecker::RegexpComparator

Inherits:
Comparator show all
Defined in:
lib/comparators/regexp_comparator.rb

Instance Method Summary collapse

Methods inherited from Comparator

#compare, #expected, #initialize

Constructor Details

This class inherits a constructor from TextChecker::Comparator

Instance Method Details

#success?(source) ⇒ Boolean

Returns:

  • (Boolean)


3
4
5
# File 'lib/comparators/regexp_comparator.rb', line 3

def success?(source)
  !!Regexp.new(expected).match(source)
end