File: watchman_file_scanner_spec.rb

package info (click to toggle)
vim-command-t 5.0.2-5-g7147ba9-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 744 kB
  • sloc: ruby: 3,394; ansic: 1,177; makefile: 27; sh: 26; xml: 11
file content (23 lines) | stat: -rw-r--r-- 633 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Copyright 2015-present Greg Hurrell. All rights reserved.
# Licensed under the terms of the BSD 2-clause license.

require 'spec_helper'

describe CommandT::Scanner::FileScanner::WatchmanFileScanner do
  context 'when an error occurs' do
    it 'falls back to the FindFileScanner' do
      # fake an error
      scanner = described_class.new
      stub(scanner).get_raw_sockname do
        raise described_class::WatchmanError
      end

      # expect call on superclass
      any_instance_of(CommandT::Scanner::FileScanner::FindFileScanner) do |klass|
        mock(klass).paths!
      end

      scanner.paths!
    end
  end
end