Skip to content

Latest commit

 

History

History
12 lines (9 loc) · 320 Bytes

case-insensitive-matchers.md

File metadata and controls

12 lines (9 loc) · 320 Bytes

Case Insensitive Matchers

You can make Ruby regex matchers case insensitive with an i.

2.1.0 :001 > 'Expected output' =~ /expected/
 => nil
2.1.0 :002 > 'Expected output' =~ /expected/i
=> 0

This is useful when writing tests, when you care about a message, but are not interested in its exact format.