spec/unit/module_tool/applications/searcher_spec.rb in puppet-3.0.0.rc4 vs spec/unit/module_tool/applications/searcher_spec.rb in puppet-3.0.0.rc5
- old
+ new
@@ -1,30 +1,33 @@
require 'spec_helper'
require 'puppet/module_tool/applications'
require 'puppet_spec/modules'
-describe Puppet::ModuleTool::Applications::Searcher, :fails_on_windows => true do
+describe Puppet::ModuleTool::Applications::Searcher do
include PuppetSpec::Files
describe "when searching" do
let(:forge) { mock 'forge' }
+ let(:searcher) do
+ pending("porting to Windows", :if => Puppet.features.microsoft_windows?) do
+ described_class.new('search_term', forge)
+ end
+ end
it "should return results from a forge query when successful" do
results = 'mock results'
forge.expects(:search).with('search_term').returns(results)
- searcher = Puppet::ModuleTool::Applications::Searcher.new('search_term', forge)
search_result = searcher.run
search_result.should == {
:result => :success,
:answers => results,
}
end
it "should return an error when the forge query throws an exception" do
forge.expects(:search).with('search_term').raises Puppet::Forge::Errors::ForgeError.new("something went wrong")
-
- searcher = Puppet::ModuleTool::Applications::Searcher.new('search_term', forge)
+
search_result = searcher.run
search_result.should == {
:result => :failure,
:error => {
:oneline => 'something went wrong',