Skip to content

Commit 40666f2

Browse files
committed
Add Ruby 4 and stop using minitest/mock for stub
For some reason this stopped working in CI and we don't really need it. I'm not sure why we did it in this way instead of using `mocha` ^_^U
1 parent d00184a commit 40666f2

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
- 3.2
3030
- 3.3
3131
- 3.4
32+
- 4.0
3233
database: [ mysql, postgres, sqlite ]
3334
gemfile: [ rails_7_1, rails_7_2, rails_8_0, rails_8_1, rails_main ]
3435
exclude:

test/models/solid_queue/process_test.rb

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
require "test_helper"
2-
require "minitest/mock"
32

43
class SolidQueue::ProcessTest < ActiveSupport::TestCase
54
test "prune processes with expired heartbeats" do
@@ -58,16 +57,16 @@ class SolidQueue::ProcessTest < ActiveSupport::TestCase
5857

5958
test "hostname's with special characters are properly loaded" do
6059
worker = SolidQueue::Worker.new(queues: "*", threads: 3, polling_interval: 0.2)
61-
hostname = "Basecamps-Computer"
60+
hostname = "Basecamp's-Computer"
6261

63-
Socket.stub :gethostname, hostname.dup.force_encoding("ASCII-8BIT") do
64-
worker.start
65-
wait_for_registered_processes(1, timeout: 1.second)
62+
Socket.stubs(:gethostname).returns(hostname.dup.force_encoding("ASCII-8BIT"))
6663

67-
assert_equal hostname, SolidQueue::Process.last.hostname
64+
worker.start
65+
wait_for_registered_processes(1, timeout: 1.second)
6866

69-
worker.stop
70-
end
67+
assert_equal hostname, SolidQueue::Process.last.hostname
68+
69+
worker.stop
7170
end
7271

7372
test "clear unregistered changes before locking for heartbeat" do

0 commit comments

Comments
 (0)