diff --git a/lib/docker-sync/dependencies.rb b/lib/docker-sync/dependencies.rb index 7d99bb9b..c2b21348 100644 --- a/lib/docker-sync/dependencies.rb +++ b/lib/docker-sync/dependencies.rb @@ -27,7 +27,7 @@ def self.ensure_all_for_mac!(config) unless Fswatch.available? Fswatch.ensure! puts "please restart docker sync so the installation of fswatch takes effect" - exit 1 + raise(UNSUPPORTED_OPERATING_SYSTEM) end end diff --git a/lib/docker-sync/watch_strategy/fswatch.rb b/lib/docker-sync/watch_strategy/fswatch.rb index ad156916..63770cf1 100644 --- a/lib/docker-sync/watch_strategy/fswatch.rb +++ b/lib/docker-sync/watch_strategy/fswatch.rb @@ -25,7 +25,7 @@ def initialize(sync_name, options) exit 1 end puts "please restart docker sync so the installation of fswatch takes effect" - exit 1 + raise(UNSUPPORTED_OPERATING_SYSTEM) end end diff --git a/spec/integration/native-osx_strategy_spec.rb b/spec/integration/native-osx_strategy_spec.rb index f689aa51..c84ee4da 100644 --- a/spec/integration/native-osx_strategy_spec.rb +++ b/spec/integration/native-osx_strategy_spec.rb @@ -1,6 +1,7 @@ require 'spec_helper' require 'fileutils' require 'os' +require 'rspec/bash' RSpec.describe 'native_osx strategy', command_execution: :allowed, if: OS.mac? do include Rspec::Bash diff --git a/spec/integration/version_spec.rb b/spec/integration/version_spec.rb index d0b4410d..7cccd6bc 100644 --- a/spec/integration/version_spec.rb +++ b/spec/integration/version_spec.rb @@ -1,5 +1,7 @@ require 'spec_helper' require 'docker-sync/upgrade_check' +require 'rspec/bash' + RSpec.describe '--version', command_execution: :allowed do include Rspec::Bash diff --git a/spec/lib/docker-sync/dependencies_spec.rb b/spec/lib/docker-sync/dependencies_spec.rb index 5ebba98c..259ef5f5 100644 --- a/spec/lib/docker-sync/dependencies_spec.rb +++ b/spec/lib/docker-sync/dependencies_spec.rb @@ -57,6 +57,7 @@ describe '.ensure_all_for_mac!(config)' do before do allow(described_class::PackageManager).to receive(:ensure!) + #allow(DockerSync::Dependencies::Fswatch).to receive(:ensure!).and_return(true) allow(described_class::Docker).to receive(:ensure!) end diff --git a/spec/lib/docker-sync/project_config_spec.rb b/spec/lib/docker-sync/project_config_spec.rb index 26cfb152..5c9542cd 100644 --- a/spec/lib/docker-sync/project_config_spec.rb +++ b/spec/lib/docker-sync/project_config_spec.rb @@ -6,8 +6,12 @@ let(:default_watch_strategy) { OS.linux? ? 'dummy' : 'unison' } subject { described_class.new } + before do + allow(DockerSync::Dependencies::Docker::Driver).to receive(:system).with('pgrep -q com.docker.hyperkit').and_return(true) + end describe '#initialize' do + describe 'minimum configuration with defaults' do it 'loads simplest config' do use_fixture 'simplest' do