From 41219968920010a79399e7f4c6f3c88ffbd4eec2 Mon Sep 17 00:00:00 2001 From: Erik Ogan Date: Wed, 5 Feb 2014 12:11:07 -0800 Subject: [PATCH] ethnocentric.american.programmers-- --- lib/lita/handlers/karma.rb | 2 +- spec/lita/handlers/karma_spec.rb | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/lita/handlers/karma.rb b/lib/lita/handlers/karma.rb index 4cceb5b..a22165f 100644 --- a/lib/lita/handlers/karma.rb +++ b/lib/lita/handlers/karma.rb @@ -4,7 +4,7 @@ module Lita module Handlers # Tracks karma points for arbitrary terms. class Karma < Handler - TERM_PATTERN = /[\[\]\w\._|\{\}]{2,}/ + TERM_PATTERN = /[\[\]\p{Word}\._|\{\}]{2,}/ class << self attr_accessor :term_pattern diff --git a/spec/lita/handlers/karma_spec.rb b/spec/lita/handlers/karma_spec.rb index d3f7365..a1305d6 100644 --- a/spec/lita/handlers/karma_spec.rb +++ b/spec/lita/handlers/karma_spec.rb @@ -1,3 +1,4 @@ +# Encoding: UTF-8 require "spec_helper" describe Lita::Handlers::Karma, lita_handler: true do @@ -68,6 +69,11 @@ send_message("FOO++") expect(replies.last).to eq("foo: 2") end + + it "handles Unicode word characters" do + send_message("föö++") + expect(replies.last).to eq("föö: 1") + end end describe "#decrement" do