Commit 5467b1f4 authored by Eloy Duran's avatar Eloy Duran

Make the search spec less brittle.

parent 97b8bb7b
......@@ -66,61 +66,31 @@ describe "Pod::Command" do
it "searches for a pod with name matching the given query ignoring case" do
[
[
' s ',
"==> ASIHTTPRequest (1.8.1)\n" \
" Easy to use CFNetwork wrapper for HTTP requests, Objective-C, " \
"Mac OS X and iPhone\n\n" \
"==> ASIWebPageRequest (1.8.1)\n" \
" The ASIWebPageRequest class included with ASIHTTPRequest lets you " \
"download\n complete webpages, including external resources like " \
"images and stylesheets.\n\n" \
"==> JSONKit (1.4)\n" \
" A Very High Performance Objective-C JSON Library.\n\n" \
"==> SSZipArchive (0.1.0)\n" \
" Utility class for unzipping files on iOS and Mac.\n\n"
],
[
'json',
"==> JSONKit (1.4)\n" \
" A Very High Performance Objective-C JSON Library.\n\n",
]
].each do |query, result|
[' s ', %w{ ASIHTTPRequest ASIWebPageRequest JSONKit SSZipArchive }],
['json', %w{ JSONKit SBJson }],
].each do |query, results|
command = Pod::Command.parse('search', '--silent', query)
def command.puts(msg = '')
(@printed ||= '') << "#{msg}\n"
end
command.run
printed = command.instance_variable_get(:@printed)
result.split("\n\n").each { |pod| printed.should.include? pod }
results.each { |pod| printed.should.include? pod }
end
end
it "searches for a pod with name, summary, or description matching the given query ignoring case" do
[
[
'systemCONfiguration',
"==> Reachability (2.0.4)\n" \
" A wrapper for the SystemConfiguration Reachablity APIs.\n\n",
],
[
'is',
"==> ASIHTTPRequest (1.8.1)\n" \
" Easy to use CFNetwork wrapper for HTTP requests, Objective-C, " \
"Mac OS X and iPhone\n\n" \
"==> Reachability (2.0.4)\n" \
" A wrapper for the SystemConfiguration Reachablity APIs.\n\n" \
"==> SSZipArchive (0.1.0)\n" \
" Utility class for unzipping files on iOS and Mac.\n\n"
]
].each do |query, result|
['systemCONfiguration', %w{ Reachablity }],
['is', %w{ ASIHTTPRequest Reachablity SSZipArchive }],
].each do |query, results|
command = Pod::Command.parse('search', '--silent', '--full', query)
def command.puts(msg = '')
(@printed ||= '') << "#{msg}\n"
end
command.run
printed = command.instance_variable_get(:@printed)
result.split("\n\n").each { |pod| printed.should.include? pod }
results.each { |pod| printed.should.include? pod }
end
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