Revert "FIX: remove deperecated Minitest global assertions"

Revert “FIX: remove deperecated Minitest global assertions”

This reverts commit fdb8425e607f505b296ee0afec896b1ebe3bba59.

diff --git a/spec/lib/message_bus/assets/asset_encoding_spec.rb b/spec/lib/message_bus/assets/asset_encoding_spec.rb
index 1c4a421..3f74e80 100644
--- a/spec/lib/message_bus/assets/asset_encoding_spec.rb
+++ b/spec/lib/message_bus/assets/asset_encoding_spec.rb
@@ -6,7 +6,7 @@ asset_file_names = asset_file_paths.map { |e| File.basename(e) }
 
 describe asset_file_names do
   it 'should contain .js files' do
-    _(asset_file_names).must_include('message-bus.js')
+    asset_file_names.must_include('message-bus.js')
   end
 end
 
diff --git a/spec/lib/message_bus/backend_spec.rb b/spec/lib/message_bus/backend_spec.rb
index 03cab13..07b9e6d 100644
--- a/spec/lib/message_bus/backend_spec.rb
+++ b/spec/lib/message_bus/backend_spec.rb
@@ -15,7 +15,7 @@ describe PUB_SUB_CLASS do
 
   describe "API parity" do
     it "has the same public methods as the base class" do
-      _(@bus.public_methods.sort).must_equal MessageBus::Backends::Base.new(MESSAGE_BUS_CONFIG).public_methods.sort
+      @bus.public_methods.sort.must_equal MessageBus::Backends::Base.new(MESSAGE_BUS_CONFIG).public_methods.sort
     end
   end
 
@@ -23,14 +23,14 @@ describe PUB_SUB_CLASS do
     @bus.publish "/foo", "bar"
     @bus.publish "/foo", "baz"
 
-    _(@bus.backlog("/foo", 0).to_a).must_equal [
+    @bus.backlog("/foo", 0).to_a.must_equal [
       MessageBus::Message.new(1, 1, '/foo', 'bar'),
       MessageBus::Message.new(2, 2, '/foo', 'baz')
     ]
   end
 
   it "should initialize with max_backlog_size" do
-    _(PUB_SUB_CLASS.new({}, 2000).max_backlog_size).must_equal 2000
+    PUB_SUB_CLASS.new({}, 2000).max_backlog_size.must_equal 2000
   end
 
   it "should truncate channels correctly" do
@@ -44,7 +44,7 @@ describe PUB_SUB_CLASS do
       @bus.publish "/foo", t
     end
 
-    _(@bus.backlog("/foo").to_a).must_equal [
+    @bus.backlog("/foo").to_a.must_equal [
       MessageBus::Message.new(3, 3, '/foo', 'three'),
       MessageBus::Message.new(4, 4, '/foo', 'four'),
     ]
@@ -56,14 +56,14 @@ describe PUB_SUB_CLASS do
     @bus.publish "/bar", "two"
     @bus.publish "/baz", "three"
 
-    _(@bus.global_backlog.length).must_equal 2
+    @bus.global_backlog.length.must_equal 2
   end
 
   it "should be able to grab a message by id" do
     id1 = @bus.publish "/foo", "bar"
     id2 = @bus.publish "/foo", "baz"
-    _(@bus.get_message("/foo", id2)).must_equal MessageBus::Message.new(2, 2, "/foo", "baz")
-    _(@bus.get_message("/foo", id1)).must_equal MessageBus::Message.new(1, 1, "/foo", "bar")
+    @bus.get_message("/foo", id2).must_equal MessageBus::Message.new(2, 2, "/foo", "baz")
+    @bus.get_message("/foo", id1).must_equal MessageBus::Message.new(1, 1, "/foo", "bar")
   end
 
   it "should have the correct number of messages for multi threaded access" do
@@ -82,13 +82,13 @@ describe PUB_SUB_CLASS do
 
   it "should be able to encode and decode messages properly" do
     m = MessageBus::Message.new 1, 2, '||', '||'
-    _(MessageBus::Message.decode(m.encode)).must_equal m
+    MessageBus::Message.decode(m.encode).must_equal m
   end
 
   it "should allow us to get last id on a channel" do
-    _(@bus.last_id("/foo")).must_equal 0
+    @bus.last_id("/foo").must_equal 0
     @bus.publish("/foo", "one")
-    _(@bus.last_id("/foo")).must_equal 1
+    @bus.last_id("/foo").must_equal 1
   end
 
   describe "readonly" do
@@ -109,16 +109,16 @@ describe PUB_SUB_CLASS do
       3.times do
         result = @bus.publish "/foo", "bar"
         assert_nil result
-        _(Thread.list.length).must_equal(current_threads_length + 1)
+        Thread.list.length.must_equal(current_threads_length + 1)
       end
 
       @bus.pub_redis.slaveof "no", "one"
       sleep 0.01
 
       (Thread.list - current_threads).each(&:join)
-      _(Thread.list.length).must_equal current_threads_length
+      Thread.list.length.must_equal current_threads_length
 
-      _(@bus.backlog("/foo", 0).map(&:data)).must_equal ["bar", "bar"]
+      @bus.backlog("/foo", 0).map(&:data).must_equal ["bar", "bar"]
     end
   end
 
@@ -131,8 +131,8 @@ describe PUB_SUB_CLASS do
     @bus.publish "/foo", "bar"
     expected_backlog_size += 1
 
-    _(@bus.global_backlog.length).must_equal expected_backlog_size
-    _(@bus.backlog("/foo", 0).length).must_equal expected_backlog_size
+    @bus.global_backlog.length.must_equal expected_backlog_size
+    @bus.backlog("/foo", 0).length.must_equal expected_backlog_size
 
     sleep 1.25 # Should now be at time =~ 1.25s. Our backlog should have expired by now.
     expected_backlog_size = 0
@@ -140,15 +140,15 @@ describe PUB_SUB_CLASS do
     case MESSAGE_BUS_CONFIG[:backend]
     when :postgres
       # Force triggering backlog expiry: postgres backend doesn't expire backlogs on a timer, but at publication time.
-      _(@bus.global_backlog.length).wont_equal expected_backlog_size
-      _(@bus.backlog("/foo", 0).length).wont_equal expected_backlog_size
+      @bus.global_backlog.length.wont_equal expected_backlog_size
+      @bus.backlog("/foo", 0).length.wont_equal expected_backlog_size
       @bus.publish "/foo", "baz"
       expected_backlog_size += 1
     end
 
     # Assert that the backlog did expire, and now has only the new publication in it.
-    _(@bus.global_backlog.length).must_equal expected_backlog_size
-    _(@bus.backlog("/foo", 0).length).must_equal expected_backlog_size
+    @bus.global_backlog.length.must_equal expected_backlog_size
+    @bus.backlog("/foo", 0).length.must_equal expected_backlog_size
 
     sleep 0.75 # Should now be at time =~ 2s
 
@@ -168,8 +168,8 @@ describe PUB_SUB_CLASS do
     else
       # Assert that the backlog did not expire, and has all of our publications since the last expiry.
     end
-    _(@bus.global_backlog.length).must_equal expected_backlog_size
-    _(@bus.backlog("/foo", 0).length).must_equal expected_backlog_size
+    @bus.global_backlog.length.must_equal expected_backlog_size
+    @bus.backlog("/foo", 0).length.must_equal expected_backlog_size
   end
 
   it "can set backlog age on publish" do
@@ -183,8 +183,8 @@ describe PUB_SUB_CLASS do
     @bus.publish "/foo", "bar", max_backlog_age: 1
     expected_backlog_size += 1
 
-    _(@bus.global_backlog.length).must_equal expected_backlog_size
-    _(@bus.backlog("/foo", 0).length).must_equal expected_backlog_size
+    @bus.global_backlog.length.must_equal expected_backlog_size
+    @bus.backlog("/foo", 0).length.must_equal expected_backlog_size
 
     sleep 1.25 # Should now be at time =~ 1.25s. Our backlog should have expired by now.
     expected_backlog_size = 0
@@ -192,15 +192,15 @@ describe PUB_SUB_CLASS do
     case MESSAGE_BUS_CONFIG[:backend]
     when :postgres
       # Force triggering backlog expiry: postgres backend doesn't expire backlogs on a timer, but at publication time.
-      _(@bus.global_backlog.length).wont_equal expected_backlog_size
-      _(@bus.backlog("/foo", 0).length).wont_equal expected_backlog_size
+      @bus.global_backlog.length.wont_equal expected_backlog_size
+      @bus.backlog("/foo", 0).length.wont_equal expected_backlog_size
       @bus.publish "/foo", "baz", max_backlog_age: 1
       expected_backlog_size += 1
     end
 
     # Assert that the backlog did expire, and now has only the new publication in it.
-    _(@bus.global_backlog.length).must_equal expected_backlog_size
-    _(@bus.backlog("/foo", 0).length).must_equal expected_backlog_size
+    @bus.global_backlog.length.must_equal expected_backlog_size
+    @bus.backlog("/foo", 0).length.must_equal expected_backlog_size
 
     # for the time being we can give pg a pass here
     # TODO: make the implementation here consistent
@@ -208,7 +208,7 @@ describe PUB_SUB_CLASS do
       # ids are not opaque we expect them to be reset on our channel if it
       # got cleared due to an expire, the reason for this is cause we will leak entries due to tracking
       # this in turn can bloat storage for the backend
-      _(@bus.last_id("/foo")).must_equal initial_id
+      @bus.last_id("/foo").must_equal initial_id
     end
 

[... diff too long, it was truncated ...]

GitHub sha: ae0bf0f0

This commit appears in #215 which was merged by @SamSaffron.