Stub background job of updating search index in tests

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