Skip to content

Commit

Permalink
Use raw Pathname to fix Linux specs.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Dec 15, 2018
1 parent 4665942 commit 2908365
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lib/listen/adapter/linux.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def _process_event(dir, event)
# will need to have a custom recursion implemented
# to properly match events to configured directories
path = Pathname.new(event.watcher.path) + event.name
rel_path = path.relative_path_from(dir.to_s).to_s
rel_path = path.relative_path_from(dir).to_s

_log(:debug) { "inotify: #{rel_path} (#{event.flags.inspect})" }

Expand Down
12 changes: 1 addition & 11 deletions spec/lib/listen/adapter/linux_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,7 @@
end

if linux?
let(:dir1) do
instance_double(
Pathname,
'dir1',
to_s: '/foo/dir1',
cleanpath: real_dir1
)
end

# just so cleanpath works in above double
let(:real_dir1) { instance_double(Pathname, 'dir1', to_s: '/foo/dir1') }
let(:dir1) {Pathname.new("/foo/dir1")}

let(:config) { instance_double(Listen::Adapter::Config) }
let(:queue) { instance_double(Queue) }
Expand Down

0 comments on commit 2908365

Please sign in to comment.