Stub background job of updating search index in tests

parent 6474bfbd
...@@ -19,6 +19,7 @@ module Pod ...@@ -19,6 +19,7 @@ module Pod
`git fetch -q` `git fetch -q`
`git branch --set-upstream-to=origin/master master` `git branch --set-upstream-to=origin/master master`
end end
SourcesManager.expects(:update_search_index_if_needed_in_background).with({}).returns(nil)
lambda { command('repo', 'update').run }.should.not.raise lambda { command('repo', 'update').run }.should.not.raise
end end
...@@ -27,6 +28,12 @@ module Pod ...@@ -27,6 +28,12 @@ module Pod
repo2 = repo_clone('repo1', 'repo2') repo2 = repo_clone('repo1', 'repo2')
repo_make_readme_change(repo1, 'Updated') repo_make_readme_change(repo1, 'Updated')
Dir.chdir(repo1) { `git commit -a -m "Update"` } Dir.chdir(repo1) { `git commit -a -m "Update"` }
SourcesManager.expects(:update_search_index_if_needed_in_background).with() { |value|
value.each_pair { |source, paths|
source.name.should == 'repo2'
paths.should == ['README']
}
}
run_command('repo', 'update', 'repo2') run_command('repo', 'update', 'repo2')
(repo2 + 'README').read.should.include 'Updated' (repo2 + 'README').read.should.include 'Updated'
end end
......
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