refactored pattern_matching_spec.rb