Commit e5996e10 authored by Ben Asher's avatar Ben Asher

Fixed tests and rubocop issue

parent 3f68c358
......@@ -218,7 +218,7 @@ module Pod
# @return result of calling the git! with args in repo_dir
#
def repo_git(*args)
git!(["-C", repo_dir] + args)
git!(['-C', repo_dir] + args)
end
# @return [Pathname] The directory of the repository.
......
......@@ -91,7 +91,7 @@ module Pod
set_up_test_repo_for_update
@sources_manager.expects(:update_search_index_if_needed_in_background).with({}).returns(nil)
MasterSource.any_instance.expects(:git!).with do |options|
options.join(' ').should.equal %W(-C #{test_repo_path} pull --ff-only).join(' ')
options.join(' ') == %W(-C #{test_repo_path} pull --ff-only).join(' ')
end
@sources_manager.update(test_repo_path.basename.to_s, true)
end
......@@ -108,10 +108,10 @@ module Pod
test_repo_path.join('.git', 'shallow').open('w') { |f| f << 'a' * 40 }
@sources_manager.expects(:update_search_index_if_needed_in_background).with({}).returns(nil)
MasterSource.any_instance.expects(:git!).with do |options|
options.join(' ').should.equal %W(-C #{test_repo_path} fetch --unshallow).join(' ')
options.join(' ') == %W(-C #{test_repo_path} fetch --unshallow).join(' ')
end
MasterSource.any_instance.expects(:git!).with do |options|
options.join(' ').should.equal %W(-C #{test_repo_path} pull --ff-only).join(' ')
options.join(' ') == %W(-C #{test_repo_path} pull --ff-only).join(' ')
end
@sources_manager.update(test_repo_path.basename.to_s, true)
......@@ -121,13 +121,13 @@ module Pod
it 'prints a warning if the update failed' do
set_up_test_repo_for_update
Source.any_instance.stubs(:git).with do |options|
options.join(' ').should.equal %W(-C #{test_repo_path} rev-parse HEAD).join(' ')
options.join(' ') == %W(-C #{test_repo_path} rev-parse HEAD).join(' ')
end.returns('aabbccd')
Source.any_instance.stubs(:git).with do |options|
options.join(' ').should.equal %W(-C #{test_repo_path} diff --name-only aabbccd..HEAD).join(' ')
options.join(' ') == %W(-C #{test_repo_path} diff --name-only aabbccd..HEAD).join(' ')
end.returns('')
MasterSource.any_instance.expects(:git!).with do |options|
options.join(' ').should.equal %W(-C #{test_repo_path} pull --ff-only).join(' ')
options.join(' ') == %W(-C #{test_repo_path} pull --ff-only).join(' ')
end.raises(<<-EOS)
fatal: '/dev/null' does not appear to be a git repository
fatal: Could not read from remote repository.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment