Skip to content

Commit

Permalink
Include macOS Big Sur in Adapter::Darwin#usable?
Browse files Browse the repository at this point in the history
macOS Big Sur has target_os=darwin20
Change Darwin-adapter-regex to look for version numbers in [10,29], previously only [10,19]
  • Loading branch information
christiankn committed Jul 21, 2020
1 parent ba5059c commit b34f517
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/listen/adapter/darwin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module Adapter
# Adapter implementation for Mac OS X `FSEvents`.
#
class Darwin < Base
OS_REGEXP = /darwin(?<major_version>1\d+)/i
OS_REGEXP = /darwin(?<major_version>(1|2)\d+)/i

# The default delay between checking for changes.
DEFAULTS = { latency: 0.1 }.freeze
Expand Down
8 changes: 8 additions & 0 deletions spec/lib/listen/adapter/darwin_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@
it { should be_usable }
end

context 'on darwin20 (macOS Big Sur)' do
before do
allow(RbConfig::CONFIG).to receive(:[]).and_return('darwin20')
end

it { should be_usable }
end

context 'on darwin10.0 (OS X Snow Leopard)' do
before do
allow(RbConfig::CONFIG).to receive(:[]).and_return('darwin10.0')
Expand Down

0 comments on commit b34f517

Please sign in to comment.