Skip to content

Commit f1e26ee

Browse files
committed
Fix tests
1 parent c66bbe7 commit f1e26ee

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
source 'https://rubygems.org'
22
gem 'minitest-autotest'
3+
gem 'rake'

lib/cinch/logger/formatted_logger.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ def colorize(text, *codes)
4040
end
4141

4242
def format_general(message)
43-
# :print: doesn't call all of :space: so use both.
44-
message.gsub(/[^[:print:][:space:]]/) do |m|
43+
message.gsub(/[^[:print:]]/) do |m|
4544
colorize(m.inspect[1..-2], :bg_white, :black)
4645
end
4746
end

test/helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
require 'minitest/autorun'
1515

16-
class TestCase < MiniTest::Unit::TestCase
16+
class TestCase < MiniTest::Test
1717
def self.test(name, &block)
1818
define_method("test_" + name, &block) if block
1919
end

test/lib/cinch/plugin.rb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ def setup
2222
@plugin.match(/pattern/)
2323
matcher = @plugin.matchers.last
2424

25-
assert_equal(1, @plugin.matchers.size, "Shoult not forget existing matchers")
26-
assert_equal Cinch::Plugin::ClassMethods::Matcher.new(/pattern/, true, true, :execute), matcher
25+
assert_equal(1, @plugin.matchers.size, "Should not forget existing matchers")
26+
assert_equal Cinch::Plugin::ClassMethods::Matcher.new(/pattern/, true, true, :execute, nil, nil, nil, nil, false), matcher
2727

2828
matcher = @plugin.match(/pattern/, use_prefix: false, use_suffix: false, method: :some_method)
29-
assert_equal Cinch::Plugin::ClassMethods::Matcher.new(/pattern/, false, false, :some_method), matcher
29+
assert_equal Cinch::Plugin::ClassMethods::Matcher.new(/pattern/, false, false, :some_method, nil, nil, nil, nil, false), matcher
3030
end
3131

3232
test "should be able to listen to events" do
@@ -108,55 +108,55 @@ def setup
108108
@plugin.set :prefix, "some prefix"
109109
@plugin.set :suffix, "some suffix"
110110
@plugin.set :plugin_name, "some plugin"
111-
@plugin.set :reacting_on, :event1
111+
@plugin.set :react_on, :event1
112112

113113
assert_equal "some help message", @plugin.help
114114
assert_equal "some prefix", @plugin.prefix
115115
assert_equal "some suffix", @plugin.suffix
116116
assert_equal "some plugin", @plugin.plugin_name
117-
assert_equal :event1, @plugin.reacting_on
117+
assert_equal :event1, @plugin.react_on
118118
end
119119

120120
test "should support `set(key => value, key => value, ...)`" do
121121
@plugin.set(:help => "some help message",
122122
:prefix => "some prefix",
123123
:suffix => "some suffix",
124124
:plugin_name => "some plugin",
125-
:reacting_on => :event1)
125+
:react_on => :event1)
126126

127127
assert_equal "some help message", @plugin.help
128128
assert_equal "some prefix", @plugin.prefix
129129
assert_equal "some suffix", @plugin.suffix
130130
assert_equal "some plugin", @plugin.plugin_name
131-
assert_equal :event1, @plugin.reacting_on
131+
assert_equal :event1, @plugin.react_on
132132
end
133133

134134
test "should support `self.key = value`" do
135135
@plugin.help = "some help message"
136136
@plugin.prefix = "some prefix"
137137
@plugin.suffix = "some suffix"
138138
@plugin.plugin_name = "some plugin"
139-
@plugin.reacting_on = :event1
139+
@plugin.react_on = :event1
140140

141141
assert_equal "some help message", @plugin.help
142142
assert_equal "some prefix", @plugin.prefix
143143
assert_equal "some suffix", @plugin.suffix
144144
assert_equal "some plugin", @plugin.plugin_name
145-
assert_equal :event1, @plugin.reacting_on
145+
assert_equal :event1, @plugin.react_on
146146
end
147147

148148
test "should support querying attributes" do
149149
@plugin.plugin_name = "foo"
150150
@plugin.help = "I am a help message"
151151
@plugin.prefix = "^"
152152
@plugin.suffix = "!"
153-
@plugin.react_on(:event1)
153+
@plugin.react_on = :event1
154154

155155
assert_equal "foo", @plugin.plugin_name
156156
assert_equal "I am a help message", @plugin.help
157157
assert_equal "^", @plugin.prefix
158158
assert_equal "!", @plugin.suffix
159-
assert_equal :event1, @plugin.reacting_on
159+
assert_equal :event1, @plugin.react_on
160160
end
161161

162162
test "should have a default name" do

0 commit comments

Comments
 (0)