Commit f78441dd authored by Fabio Pelosin's avatar Fabio Pelosin

[Specs] More fixes.

parent f5e49dbb
......@@ -91,7 +91,7 @@ module Pod
if `which xcodebuild`.strip.empty?
puts "Skipping compilation with `xcodebuild' because it can't be found.\n".yellow if config.verbose?
else
puts "Building with xcodebuild.\n".yellow if config.verbose?
puts "\nBuilding with xcodebuild.\n".yellow if config.verbose?
# treat xcodebuild warnings as notes because the spec maintainer might not be the author of the library
xcodebuild_output.each { |msg| ( msg.include?('error: ') ? @platform_errors[@platform] : @platform_notes[@platform] ) << msg }
end
......@@ -103,6 +103,7 @@ module Pod
def install_pod
podfile = podfile_from_spec
config.verbose
config.skip_repo_update = true
sandbox = Sandbox.new(config.project_pods_root)
resolver = Resolver.new(podfile, nil, sandbox)
installer = Installer.new(resolver)
......
......@@ -56,7 +56,7 @@ module Pod
end
def add
UI.section ("Cloning spec repo `#{@name}' from `#{@url}'#{" (branch `#{@branch}')" if @branch}") do
UI.section("Cloning spec repo `#{@name}' from `#{@url}'#{" (branch `#{@branch}')" if @branch}") do
config.repos_dir.mkpath
Dir.chdir(config.repos_dir) { git!("clone '#{@url}' #{@name}") }
Dir.chdir(dir) { git!("checkout #{@branch}") } if @branch
......
......@@ -78,7 +78,7 @@ module Pod
def integrate!
return if targets.empty?
UI.section ("Integrating `#{@target_definition.lib_name}' into #{'target'.pluralize(targets.size)} " \
UI.section("Integrating `#{@target_definition.lib_name}' into #{'target'.pluralize(targets.size)} " \
"`#{targets.map(&:name).to_sentence}' of Xcode project #{UI.path user_project_path}.") do
add_xcconfig_base_configuration
add_pods_library
......
......@@ -5,13 +5,13 @@ describe Pod::UI do
extend SpecHelper::Command
before do
@set = Pod::Source.search_by_name('CocoaLumberjack').first
@set = Pod::Source.search(Pod::Dependency.new('CocoaLumberjack'))
Pod::Specification::Statistics.instance.cache_file = nil
end
it "presents the name, version, description, homepage and source of a specification set" do
Pod::UI.pod(@set)
output = Pod::UI.output.gsub(/\n */,'')
output = Pod::UI.output
output.should.include? 'CocoaLumberjack'
output.should.include? '1.0'
output.should.include? '1.1'
......@@ -20,10 +20,9 @@ describe Pod::UI do
output.should.include? 'https://github.com/robbiehanson/CocoaLumberjack.git'
end
it "presents the name, version, description, homepage and source of a specification set" do
Pod::UI.pod(@set)
output = Pod::UI.output.gsub(/\n */,'')
output = Pod::UI.output
output.should.include? 'Versions: 1.6, 1.3.3, 1.3.2, 1.3.1, 1.3, 1.2.3, 1.2.2, 1.2.1, 1.2, 1.1, 1.0 [master repo]'
end
......
......@@ -14,10 +14,11 @@ module Bacon
c.generate_docs = false
c.skip_repo_update = true
end
::Pod::UI.output = ''
# Very nasty behaviour where the relative increments are
# not reverted and lead to sections being collapsed and
# not being printed to the output.
# The following prevents a nasty behaviour where the increments are not
# balanced when testing informatives which might lead to sections not
# being printed to the output as they are too neested.
::Pod::UI.indentation_level = 0
::Pod::UI.title_level = 0
......
......@@ -6,7 +6,8 @@ module Pod
attr_accessor :output
def puts(message = '')
@output << "#{message}"
# Wrapping can bite in tests.
@output << "#{message}".gsub(/\n/,'')
end
end
end
......
......@@ -32,9 +32,9 @@ describe "Pod::Specification::Set" do
lambda { @set.required_version }.should.raise Pod::Informative
end
it "can returns test if it is equal to another set" do
it "can test if it is equal to another set" do
@set.should == Pod::Spec::Set.new('CocoaLumberjack', @source)
@set.should != Pod::Spec::Set.new('RestKit', @source)
@set.should.not == Pod::Spec::Set.new('RestKit', @source)
end
before do
......@@ -76,7 +76,7 @@ describe "Pod::Specification::Set" do
@set.versions_by_source.each { |source, versions| hash[source.name] = versions.map(&:to_s) }
hash['master'].should == %w| 1.5pre 1.4 |
hash['test_repo'].should == %w| 999.999.999 1.4 |
hash.keys.should == %w| master test_repo |
hash.keys.sort.should == %w| master test_repo |
end
it "returns the specification from the `master` source for the required version" do
......
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