diff options
author | Matthias Hecker <mail@apoc.cc> | 2020-04-13 20:40:11 +0200 |
---|---|---|
committer | Matthias Hecker <mail@apoc.cc> | 2020-04-13 20:40:11 +0200 |
commit | 90656f4203a0a989b6fb110d4a07598dd186b84c (patch) | |
tree | 9aceacbcbfa1964376e3d1f4b59b1badcbcad971 /test | |
parent | f287bf1e73829434d92b46c333c3185373198518 (diff) |
plugin(points): new message parser, see #34
Diffstat (limited to 'test')
-rw-r--r-- | test/plugins/test_points.rb | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/test/plugins/test_points.rb b/test/plugins/test_points.rb index 83018e2e..d29b6174 100644 --- a/test/plugins/test_points.rb +++ b/test/plugins/test_points.rb @@ -49,6 +49,13 @@ class PointsPluginTest < Test::Unit::TestCase @plugin.message(m) assert_equal('alice now has 1 points!', m.replies.first) + # assign to multiple things + m = MockMessage.new('hello linux++ hello torvalds++', 'user') + @plugin.message(m) + assert_equal(m.replies.length, 2) + assert_equal('linux now has 3 points!', m.replies[0]) + assert_equal('torvalds now has 1 points!', m.replies[1]) + ignored = [ '++alice', '--alice', @@ -56,6 +63,16 @@ class PointsPluginTest < Test::Unit::TestCase 'ls --sort time', '-- foo', '++ foo', + 'test ++', + 'test --', + '<-- pointing', + 'pointing -->', + '&++', + ' ++', + ' --', + '++ --', + '-- ++', + 'https://linux.slashdot.org/story/20/04/12/2138205/how-red-hats-new-ceo-handles-life-under-ibm----and-a-global-pandemic' ] ignored.each do |ignore| m = MockMessage.new(ignore, 'user') @@ -69,6 +86,6 @@ class PointsPluginTest < Test::Unit::TestCase m = MockMessage.new('bot++', 'user') @plugin.message(m) - assert_include(MockBot.new.lang.strings['thanks'], m.replies.first) + assert_equal('thanks :)', m.replies.first) end end |