Commit 856eb5e6 authored by Taras Kalapun's avatar Taras Kalapun

Added --all to podfile-info. Added testing spec.

parent 286762ef
......@@ -13,7 +13,7 @@ module Pod
def self.options
[
# ["--all", "Show information about all Pods with dependencies that are used in a project"],
["--all", "Show information about all Pods with dependencies that are used in a project"],
["--md", "Output information in Markdown format"]
].concat(super)
end
......@@ -32,8 +32,11 @@ module Pod
UI.puts "Using lockfile" if config.verbose?
verify_lockfile_exists!
lockfile = config.lockfile
# pods = (@info_all) ? lockfile.dependencies : lockfile.pod_names
pods = lockfile.pod_names
if @info_all
deps = lockfile.dependencies.map{|d| d.name}
pods = (deps + pods).uniq
end
elsif @podfile_path
podfile = Pod::Podfile.from_file(@podfile_path)
pods = pods_from_podfile(podfile)
......@@ -43,7 +46,7 @@ module Pod
pods = pods_from_podfile(podfile)
end
UI.puts "\nPods used:\n".yellow unless (config.silent || @info_in_md)
UI.puts "\nPods used:\n".yellow unless @info_in_md
pods_info(pods, @info_in_md)
end
......
require File.expand_path('../../../spec_helper', __FILE__)
module Pod
describe Command::PodfileInfo do
extend SpecHelper::TemporaryRepos
before do
@test_source = Source.new(fixture('spec-repos/test_repo'))
Source::Aggregate.any_instance.stubs(:all).returns([@test_source])
SourcesManager.updated_search_index = nil
end
it "tells the user pods info from Podfile" do
file = temporary_directory + 'Podfile'
text = <<-PODFILE
platform :ios
pod 'BananaLib'
pod 'JSONKit'
PODFILE
File.open(file, 'w') {|f| f.write(text) }
Dir.chdir(temporary_directory) do
output = run_command('podfile-info')
output.should.include? '- BananaLib - Chunky bananas!'
output.should.include? '- JSONKit - A Very High Performance Objective-C JSON Library.'
end
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