Module: TarkaMatchers::Helpers::Expectation::Common

Constant Summary collapse

SGR =
/\\e\[(?:10[0-7]|0{1,2}\d|0{0,1}\d\d|\d)m/
NEWLINE =
/\\n/

Instance Method Summary collapse

Instance Method Details

#clean!(string) ⇒ Object



8
9
10
11
12
# File 'lib/tarka_matchers/helpers/expectation/common.rb', line 8

def clean! string
	string.gsub!(SGR,'') unless @keep_sgrs
	string.gsub!(NEWLINE,'') unless @keep_newlines
	string
end