diff options
| author | mo khan <mo.khan@gmail.com> | 2020-06-12 15:13:25 -0600 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2020-06-12 15:13:25 -0600 |
| commit | 50437b8b4bf9f4e17a892c5a02f086ec3ac9fd3e (patch) | |
| tree | c778930ae0700a47e3b2190b030bc10deb9336f9 /spec/integration/core/git_spec.rb | |
| parent | 9c72a8f198023431749cff4ce5e4c5e39555394d (diff) | |
Decouple spinner from thread_pool
Diffstat (limited to 'spec/integration/core/git_spec.rb')
| -rw-r--r-- | spec/integration/core/git_spec.rb | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/spec/integration/core/git_spec.rb b/spec/integration/core/git_spec.rb index 186c5b7..63bb4d8 100644 --- a/spec/integration/core/git_spec.rb +++ b/spec/integration/core/git_spec.rb @@ -17,15 +17,17 @@ RSpec.describe Spandx::Core::Git do describe '#root' do let(:expected_path) { File.expand_path(File.join(ENV['HOME'], '.local', 'share', 'spdx', 'license-list-data')) } - it { expect(subject.root).to eql(expected_path) } + it { expect(subject.root.to_s).to eql(expected_path) } end describe 'update!' do let(:expected_path) { File.expand_path(File.join(ENV['HOME'], '.local', 'share', 'spdx', 'license-list-data')) } context 'when the repository has not been cloned' do + let(:git_path) { instance_double(Pathname, directory?: false) } + before do - allow(File).to receive(:directory?).with(File.join(expected_path, '.git')).and_return(false) + allow(subject.root).to receive(:join).with('.git').and_return(git_path) subject.update! end @@ -34,9 +36,11 @@ RSpec.describe Spandx::Core::Git do end context 'when the repository has already been cloned' do + let(:git_path) { instance_double(Pathname, directory?: true) } + before do - allow(File).to receive(:directory?).with(File.join(expected_path, '.git')).and_return(true) - allow(Dir).to receive(:chdir).with(expected_path).and_yield + allow(subject.root).to receive(:join).with('.git').and_return(git_path) + allow(Dir).to receive(:chdir).with(Pathname(expected_path)).and_yield subject.update! end |
