Skip to content

Commit

Permalink
Merge pull request #683 from jeremyevans/mutex-sleep-nil-fix-16608
Browse files Browse the repository at this point in the history
Handle Mutex#sleep change planned in Ruby 3.1
  • Loading branch information
soutaro authored Jun 21, 2021
2 parents 85e9920 + 9b91363 commit 3c046c7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion stdlib/mutex_m/0/mutex_m.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ module Mutex_m

# See Mutex#sleep
#
def sleep: (?Numeric timeout) -> Integer
def sleep: (?Numeric timeout) -> Integer?

alias locked? mu_locked?
alias lock mu_lock
Expand Down
4 changes: 2 additions & 2 deletions test/stdlib/Mutex_m_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ def test_mu_unlock
def test_sleep
mu = mu()
mu.lock
assert_send_type "(Integer) -> Integer",
assert_send_type "(Integer) -> Integer?",
mu, :sleep, 0
assert_send_type "(Float) -> Integer",
assert_send_type "(Float) -> Integer?",
mu, :sleep, 0.1
end
end

0 comments on commit 3c046c7

Please sign in to comment.