Commit b255de76 authored by Eloy Durán's avatar Eloy Durán

Make specs green.

parent 054fe5c8
......@@ -8,7 +8,7 @@ GIT
GIT
remote: git://github.com/alloy/CLAide.git
revision: fdcc73837ff0c67b440fa9a20dc6366c78f06f09
revision: 324ceaf81365eb6e5936c010037887a2c8d44f3e
specs:
claide (0.0.1)
......
......@@ -89,7 +89,7 @@ module Pod
lint_argv << "--silent" if config.silent
all_valid = true
podspec_files.each do |podspec|
Spec.new(ARGV.new(lint_argv + [podspec.to_s])).run
Spec.parse(lint_argv + [podspec.to_s]).run
end
end
......
......@@ -149,17 +149,10 @@ module Pod
# TODO some of the following methods can probably move to one of the subclasses.
protected
def dir
config.repos_dir + @name
end
def print_messages(type, messages)
return if config.silent?
messages.each {|msg| UI.puts " - #{type.ljust(5)} | #{msg}"}
end
def check_versions(dir)
versions = versions(dir)
unless is_compatilbe(versions)
......@@ -172,6 +165,13 @@ module Pod
UI.puts "\nCocoapods #{versions['last']} is available.\n".green if has_update(versions) && config.new_version_message?
end
protected
def print_messages(type, messages)
return if config.silent?
messages.each {|msg| UI.puts " - #{type.ljust(5)} | #{msg}"}
end
def self.compatible?(name)
dir = Config.instance.repos_dir + name
versions = versions(dir)
......
......@@ -69,7 +69,7 @@ module Pod
end
def add_master_repo
@command ||= Repo.new(ARGV.new(['add', 'master', url, 'master'])).run
@command ||= Repo::Add.parse(['master', url, 'master']).run
end
def update_master_repo
......
......@@ -5,6 +5,8 @@ require 'active_support/core_ext/string/inflections'
module Pod
class Command
class Spec < Command
self.abstract_command = true
self.summary = 'Manage pod specs'
class Create < Spec
......@@ -18,7 +20,7 @@ module Pod
self.arguments = '[ NAME | https://github.com/USER/REPO ]'
def initialize(argv)
@url, @name_or_url = argv.shift_argument, argv.shift_argument
@name_or_url, @url = argv.shift_argument, argv.shift_argument
super
end
......
......@@ -82,7 +82,7 @@ module Pod
unless config.skip_repo_update?
UI.section 'Updating spec repositories' do
Command::Repo.new(Command::ARGV.new(["update"])).run
Command::Repo::Update.parse([]).run
end if !@lockfile || !(@pods_by_state[:added] + @pods_by_state[:changed]).empty? || update_mode
end
......
require File.expand_path('../../../spec_helper', __FILE__)
describe "Pod::Command::Install" do
extend SpecHelper::Command
extend SpecHelper::TemporaryDirectory
extend SpecHelper::TemporaryRepos
it "should include instructions on how to reference the xcode project" do
Pod::Command::Install.banner.should.match %r{xcodeproj 'path/to/XcodeProject'}
end
it "tells the user that no Podfile or podspec was found in the current working dir" do
exception = lambda { run_command('install','--no-update') }.should.raise Pod::Informative
exception.message.should.include "No `Podfile' found in the current working directory."
module Pod
describe Command::Install do
it "tells the user that no Podfile or podspec was found in the current working dir" do
exception = lambda { run_command('install', '--no-update') }.should.raise Informative
exception.message.should.include "No `Podfile' found in the current working directory."
end
end
end
require File.expand_path('../../../spec_helper', __FILE__)
describe "Pod::Command::List" do
extend SpecHelper::TemporaryRepos
module Pod
describe Command::List do
extend SpecHelper::TemporaryRepos
def command(arguments = argv)
command = Pod::Command::List.new(arguments)
end
it "complains for wrong parameters" do
lambda { command(argv('wrong')).run }.should.raise Pod::Command::Help
lambda { command(argv('--wrong')).run }.should.raise Pod::Command::Help
end
it "lists the known pods" do
out = run_command('list')
[ /ZBarSDK/,
/TouchJSON/,
/SDURLCache/,
/MagicalRecord/,
/A2DynamicDelegate/,
/\d+ pods were found/
].each { |regex| out.should =~ regex }
end
it "presents the known pods" do
list = command()
list.run
[ /ZBarSDK/,
/TouchJSON/,
/SDURLCache/,
/MagicalRecord/,
/A2DynamicDelegate/,
/\d+ pods were found/
].each { |regex| Pod::UI.output.should =~ regex }
end
it "returns the new pods" do
Time.stubs(:now).returns(Time.mktime(2012,2,3))
list = command(argv('new'))
list.run
[ 'iCarousel',
'libPusher',
'SSCheckBoxView',
'KKPasscodeLock',
'SOCKit',
'FileMD5Hash',
'cocoa-oauth',
'iRate'
].each {|s| Pod::UI.output.should.include s }
it "lists the new pods" do
Time.stubs(:now).returns(Time.mktime(2012,2,3))
out = run_command('list', 'new')
[ 'iCarousel',
'libPusher',
'SSCheckBoxView',
'KKPasscodeLock',
'SOCKit',
'FileMD5Hash',
'cocoa-oauth',
'iRate'
].each {|s| out.should.include s }
end
end
end
require File.expand_path('../../../spec_helper', __FILE__)
describe Pod::Command::Outdated do
extend SpecHelper::Command
extend SpecHelper::TemporaryDirectory
extend SpecHelper::TemporaryRepos
module Pod
describe Command::Outdated do
extend SpecHelper::TemporaryDirectory
extend SpecHelper::TemporaryRepos
it "tells the user that no Podfile was found in the current working dir" do
exception = lambda { run_command('outdated','--no-update') }.should.raise Pod::Informative
exception.message.should.include "No `Podfile' found in the current working directory."
end
it "tells the user that no Podfile was found in the current working dir" do
exception = lambda { run_command('outdated', '--no-update') }.should.raise Informative
exception.message.should.include "No `Podfile' found in the current working directory."
end
it "tells the user that no Lockfile was found in the current working dir" do
file = temporary_directory + 'Podfile'
File.open(file, 'w') {|f| f.write('platform :ios') }
Dir.chdir(temporary_directory) do
exception = lambda { run_command('outdated','--no-update') }.should.raise Pod::Informative
exception.message.should.include "No `Podfile.lock' found in the current working directory"
it "tells the user that no Lockfile was found in the current working dir" do
file = temporary_directory + 'Podfile'
File.open(file, 'w') {|f| f.write('platform :ios') }
Dir.chdir(temporary_directory) do
exception = lambda { run_command('outdated', '--no-update') }.should.raise Informative
exception.message.should.include "No `Podfile.lock' found in the current working directory"
end
end
end
end
......
require File.expand_path('../../../spec_helper', __FILE__)
describe Pod::Command::Push do
extend SpecHelper::Command
extend SpecHelper::TemporaryDirectory
extend SpecHelper::TemporaryRepos
module Pod
describe Command::Push do
extend SpecHelper::Command
extend SpecHelper::TemporaryDirectory
extend SpecHelper::TemporaryRepos
before do
config.repos_dir = SpecHelper.tmp_repos_path
end
before do
config.repos_dir = SpecHelper.tmp_repos_path
end
def master_repo
fixture('spec-repos/master')
end
def master_repo
fixture('spec-repos/master')
end
it "complains for wrong parameters" do
lambda { run_command('push') }.should.raise Pod::Command::Help
lambda { run_command('push', '--allow-warnings') }.should.raise Pod::Command::Help
lambda { run_command('push', '--wrong-option') }.should.raise Pod::Command::Help
end
it "requires a spec-repo name" do
lambda { command('push').validate! }.should.raise Command::Help
end
it "complains if it can't find the repo" do
repo1 = add_repo('repo1', master_repo)
Dir.chdir(fixture('banana-lib')) do
lambda { run_command('push', 'repo2') }.should.raise Pod::Informative
it "complains if it can't find the repo" do
repo1 = add_repo('repo1', master_repo)
Dir.chdir(fixture('banana-lib')) do
lambda { run_command('push', 'repo2') }.should.raise Informative
end
end
end
it "complains if it can't find a spec" do
repo1 = add_repo('repo1', master_repo)
lambda { run_command('push', 'repo1') }.should.raise Pod::Informative
end
it "complains if it can't find a spec" do
repo1 = add_repo('repo1', master_repo)
lambda { run_command('push', 'repo1') }.should.raise Informative
end
it "it raises if the pod is not validated" do
repo1 = add_repo('repo1', master_repo)
repo2 = add_repo('repo2', repo1.dir)
git_config('repo2', 'remote.origin.url').should == (tmp_repos_path + 'repo1').to_s
Dir.chdir(fixture('banana-lib')) do
lambda { command('push', 'repo2', '--silent').run }.should.raise Pod::Informative
it "it raises if the pod is not validated" do
repo1 = add_repo('repo1', master_repo)
repo2 = add_repo('repo2', repo1.dir)
git_config('repo2', 'remote.origin.url').should == (tmp_repos_path + 'repo1').to_s
Dir.chdir(fixture('banana-lib')) do
lambda { run_command('push', 'repo2', '--silent') }.should.raise Informative
end
# (repo1.dir + 'BananaLib/1.0/BananaLib.podspec').read.should.include 'Added!'
end
# (repo1.dir + 'BananaLib/1.0/BananaLib.podspec').read.should.include 'Added!'
end
before do
# prepare the repos
@upstream = add_repo('upstream', master_repo)
@local_repo = add_repo('local_repo', @upstream.dir)
git_config('local_repo', 'remote.origin.url').should == (tmp_repos_path + 'upstream').to_s
before do
# prepare the repos
@upstream = add_repo('upstream', master_repo)
@local_repo = add_repo('local_repo', @upstream.dir)
git_config('local_repo', 'remote.origin.url').should == (tmp_repos_path + 'upstream').to_s
# prepare the spec
spec = (fixture('spec-repos') + 'master/JSONKit/1.4/JSONKit.podspec').read
spec_fix = spec.gsub(/https:\/\/github\.com\/johnezang\/JSONKit\.git/, fixture('integration/JSONKit').to_s)
spec_add = spec.gsub(/'JSONKit'/, "'PushTest'")
File.open(temporary_directory + 'JSONKit.podspec', 'w') {|f| f.write(spec_fix) }
File.open(temporary_directory + 'PushTest.podspec', 'w') {|f| f.write(spec_add) }
end
# prepare the spec
spec = (fixture('spec-repos') + 'master/JSONKit/1.4/JSONKit.podspec').read
spec_fix = spec.gsub(/https:\/\/github\.com\/johnezang\/JSONKit\.git/, fixture('integration/JSONKit').to_s)
spec_add = spec.gsub(/'JSONKit'/, "'PushTest'")
File.open(temporary_directory + 'JSONKit.podspec', 'w') {|f| f.write(spec_fix) }
File.open(temporary_directory + 'PushTest.podspec', 'w') {|f| f.write(spec_add) }
end
it "refuses to push if the repo is not clean" do
File.open(@local_repo.dir + 'README', 'w') {|f| f.write('Added!') }
(@local_repo.dir + 'README').read.should.include 'Added!'
cmd = command('push', 'local_repo')
cmd.expects(:validate_podspec_files).returns(true)
Dir.chdir(temporary_directory) { lambda { cmd.run }.should.raise Pod::Informative }
it "refuses to push if the repo is not clean" do
File.open(@local_repo.dir + 'README', 'w') {|f| f.write('Added!') }
(@local_repo.dir + 'README').read.should.include 'Added!'
cmd = command('push', 'local_repo')
cmd.expects(:validate_podspec_files).returns(true)
Dir.chdir(temporary_directory) { lambda { cmd.run }.should.raise Informative }
(@upstream.dir + 'PushTest/1.4/PushTest.podspec').should.not.exist?
end
(@upstream.dir + 'PushTest/1.4/PushTest.podspec').should.not.exist?
end
it "sucessfully pushes a spec" do
git('upstream', 'checkout master') # checkout master, to allow push in a non-bare repository
cmd = command('push', 'local_repo')
cmd.expects(:validate_podspec_files).returns(true)
Dir.chdir(temporary_directory) { cmd.run }
it "sucessfully pushes a spec" do
git('upstream', 'checkout master') # checkout master, to allow push in a non-bare repository
cmd = command('push', 'local_repo')
cmd.expects(:validate_podspec_files).returns(true)
Dir.chdir(temporary_directory) { cmd.run }
Pod::UI.output.should.include('[Add] PushTest (1.4)')
Pod::UI.output.should.include('[Fix] JSONKit (1.4)')
UI.output.should.include('[Add] PushTest (1.4)')
UI.output.should.include('[Fix] JSONKit (1.4)')
git('upstream', 'checkout test') # checkout because test because is it the branch used in the specs.
(@upstream.dir + 'PushTest/1.4/PushTest.podspec').read.should.include('PushTest')
git('upstream', 'checkout test') # checkout because test because is it the branch used in the specs.
(@upstream.dir + 'PushTest/1.4/PushTest.podspec').read.should.include('PushTest')
end
end
end
......@@ -7,20 +7,9 @@ describe "Pod::Command::Repo" do
end
describe "In general" do
extend SpecHelper::Command
extend SpecHelper::TemporaryDirectory
extend SpecHelper::TemporaryRepos
it "runs with correct parameters" do
lambda { run_command('repo', 'update') }.should.not.raise
lambda { run_command('repo', 'lint', temporary_directory.to_s) }.should.not.raise
end
it "complains for wrong parameters" do
lambda { run_command('repo', 'add') }.should.raise Pod::Informative
lambda { run_command('repo', 'add', 'NAME') }.should.raise Pod::Informative
end
it "adds a spec-repo" do
run_command('repo', 'add', 'private', fixture('spec-repos/master'))
git_config('private', 'remote.origin.url').should == fixture('spec-repos/master').to_s
......@@ -67,7 +56,6 @@ describe "Pod::Command::Repo" do
end
describe "Concerning a repo support" do
extend SpecHelper::Command
extend SpecHelper::TemporaryDirectory
extend SpecHelper::TemporaryRepos
......
require File.expand_path('../../../spec_helper', __FILE__)
describe "Pod::Command::Search" do
extend SpecHelper::Command
extend SpecHelper::TemporaryDirectory
extend SpecHelper::TemporaryRepos
module Pod
describe Command::Search do
extend SpecHelper::TemporaryDirectory
extend SpecHelper::TemporaryRepos
before do
config.repos_dir = fixture('spec-repos')
end
before do
config.repos_dir = fixture('spec-repos')
end
it "runs with correct parameters" do
lambda { run_command('search', 'table') }.should.not.raise
lambda { run_command('search', 'table', '--full') }.should.not.raise
end
it "runs with correct parameters" do
lambda { run_command('search', 'table') }.should.not.raise
lambda { run_command('search', 'table', '--full') }.should.not.raise
end
it "complains for wrong parameters" do
lambda { run_command('search') }.should.raise Pod::Command::Help
lambda { run_command('search', 'too', 'many') }.should.raise Pod::Command::Help
lambda { run_command('search', 'too', '--wrong') }.should.raise Pod::Command::Help
lambda { run_command('search', '--wrong') }.should.raise Pod::Command::Help
end
it "complains for wrong parameters" do
lambda { run_command('search') }.should.raise Command::Help
lambda { run_command('search', 'too', 'many') }.should.raise Command::Help
lambda { run_command('search', 'too', '--wrong') }.should.raise Command::Help
lambda { run_command('search', '--wrong') }.should.raise Command::Help
end
it "presents the search results" do
output = run_command('search', 'table')
output.should.include 'EGOTableViewPullRefresh'
end
it "presents the search results" do
output = run_command('search', 'table')
output.should.include 'EGOTableViewPullRefresh'
end
it "searches for a pod with name matching the given query ignoring case" do
[
[' s ', %w{ ASIHTTPRequest ASIWebPageRequest JSONKit SSZipArchive }],
['json', %w{ JSONKit SBJson }],
].each do |query, results|
output = run_command('search', query)
results.each { |pod| output.should.include? pod }
it "searches for a pod with name matching the given query ignoring case" do
[
[' s ', %w{ ASIHTTPRequest ASIWebPageRequest JSONKit SSZipArchive }],
['json', %w{ JSONKit SBJson }],
].each do |query, results|
output = run_command('search', query)
results.each { |pod| output.should.include? pod }
end
end
end
it "searches for a pod with name, summary, or description matching the given query ignoring case" do
[
['dROP', %w{ Reachability }],
['is', %w{ ASIHTTPRequest SSZipArchive }],
['luke redpath', %w{ Kiwi libPusher LRMocky LRResty LRTableModel}],
].each do |query, results|
output = run_command('search', '--full', query)
results.each { |pod| output.should.include? pod }
it "searches for a pod with name, summary, or description matching the given query ignoring case" do
[
['dROP', %w{ Reachability }],
['is', %w{ ASIHTTPRequest SSZipArchive }],
['luke redpath', %w{ Kiwi libPusher LRMocky LRResty LRTableModel}],
].each do |query, results|
output = run_command('search', query, '--full')
results.each { |pod| output.should.include? pod }
end
end
end
end
require File.expand_path('../../../spec_helper', __FILE__)
describe "Pod::Command::Setup" do
extend SpecHelper::Command
extend SpecHelper::TemporaryDirectory
extend SpecHelper::TemporaryRepos
before do
config.repos_dir = SpecHelper.tmp_repos_path
end
it "runs with correct parameters" do
lambda { run_command('setup') }.should.not.raise
end
it "complains for wrong parameters" do
lambda { run_command('setup', 'wrong') }.should.raise Pod::Command::Help
lambda { run_command('setup', '--wrong') }.should.raise Pod::Command::Help
end
it "returns the read only URL of the `master' spec-repo" do
cmd = Pod::Command::Setup.new(argv)
cmd.url.should == 'https://github.com/CocoaPods/Specs.git'
end
it "returns the push URL of the `master' spec-repo" do
config.silent = true
cmd = Pod::Command::Setup.new(argv('--push'))
cmd.url.should == 'git@github.com:CocoaPods/Specs.git'
end
class Pod::Command::Setup
def read_only_url; SpecHelper.fixture('spec-repos/master'); end
end
it "creates the local spec-repos directory and creates a clone of the `master' repo" do
output = run_command('setup')
output.should.include "Setup completed"
output.should.not.include "push"
git_config('master', 'remote.origin.url').should == fixture('spec-repos/master').to_s
end
it "preserves push access for the `master' repo" do
output = run_command('setup')
output.should.not.include "push"
git('master', 'remote set-url origin git@github.com:CocoaPods/Specs.git')
command('setup').url.should == 'git@github.com:CocoaPods/Specs.git'
end
it "can run if needed" do
output = run_command('setup')
output.should.include "Setup completed"
Pod::UI.output = ''
command('setup').run_if_needed
Pod::UI.output.should == ''
module Pod
describe Command::Setup do
extend SpecHelper::TemporaryDirectory
extend SpecHelper::TemporaryRepos
before do
config.repos_dir = SpecHelper.tmp_repos_path
end
it "runs with correct parameters" do
lambda { run_command('setup') }.should.not.raise
end
it "complains for wrong parameters" do
lambda { run_command('setup', 'wrong') }.should.raise Command::Help
lambda { run_command('setup', '--wrong') }.should.raise Command::Help
end
it "returns the read only URL of the `master' spec-repo" do
cmd = Command::Setup.new(argv)
cmd.url.should == 'https://github.com/CocoaPods/Specs.git'
end
it "returns the push URL of the `master' spec-repo" do
config.silent = true
cmd = Command::Setup.new(argv('--push'))
cmd.url.should == 'git@github.com:CocoaPods/Specs.git'
end
class Command::Setup
def read_only_url; SpecHelper.fixture('spec-repos/master'); end
end
it "creates the local spec-repos directory and creates a clone of the `master' repo" do
output = run_command('setup')
output.should.include "Setup completed"
output.should.not.include "push"
git_config('master', 'remote.origin.url').should == fixture('spec-repos/master').to_s
end
it "preserves push access for the `master' repo" do
output = run_command('setup')
output.should.not.include "push"
git('master', 'remote set-url origin git@github.com:CocoaPods/Specs.git')
command('setup').url.should == 'git@github.com:CocoaPods/Specs.git'
end
it "can run if needed" do
output = run_command('setup')
output.should.include "Setup completed"
UI.output = ''
command('setup').run_if_needed
UI.output.should == ''
end
end
end
This diff is collapsed.
require File.expand_path('../../../spec_helper', __FILE__)
describe Pod::Command::Update do
extend SpecHelper::Command
extend SpecHelper::TemporaryDirectory
extend SpecHelper::TemporaryRepos
module Pod
describe Command::Update do
extend SpecHelper::TemporaryDirectory
extend SpecHelper::TemporaryRepos
it "tells the user that no Podfile was found in the current working dir" do
exception = lambda { run_command('update','--no-update') }.should.raise Pod::Informative
exception.message.should.include "No `Podfile' found in the current working directory."
end
it "tells the user that no Podfile was found in the current working dir" do
exception = lambda { run_command('update','--no-update') }.should.raise Informative
exception.message.should.include "No `Podfile' found in the current working directory."
end
it "tells the user that no Lockfile was found in the current working dir" do
file = temporary_directory + 'Podfile'
File.open(file, 'w') {|f| f.write('platform :ios') }
Dir.chdir(temporary_directory) do
exception = lambda { run_command('update','--no-update') }.should.raise Pod::Informative
exception.message.should.include "No `Podfile.lock' found in the current working directory"
it "tells the user that no Lockfile was found in the current working dir" do
file = temporary_directory + 'Podfile'
File.open(file, 'w') {|f| f.write('platform :ios') }
Dir.chdir(temporary_directory) do
exception = lambda { run_command('update','--no-update') }.should.raise Informative
exception.message.should.include "No `Podfile.lock' found in the current working directory"
end
end
end
end
......
require File.expand_path('../../spec_helper', __FILE__)
# describe "Pod::Command" do
# extend SpecHelper::Command
# extend SpecHelper::TemporaryDirectory
# extend SpecHelper::TemporaryRepos
#
# TODO:
# it "raises help informative if an unknown parameter is passed"
# it "performs setup if needed"
# end
......@@ -21,13 +21,18 @@ require 'spec_helper/temporary_repos'
require 'spec_helper/user_interface'
require 'spec_helper/pre_flight'
ENV['SKIP_SETUP'] = 'true'
require 'claide'
module Bacon
class Context
include Pod::Config::Mixin
include SpecHelper::Fixture
include SpecHelper::Command
def argv(*argv)
Pod::Command::ARGV.new(argv)
CLAide::ARGV.new(argv)
end
end
end
......
......@@ -4,7 +4,7 @@ module SpecHelper
module Command
def command(*argv)
argv << '--no-color'
Pod::Command.parse(*argv)
Pod::Command.parse(argv)
end
def run_command(*args)
......@@ -14,7 +14,9 @@ module SpecHelper
# been converted to use the UI.puts
config_silent = config.silent?
config.silent = false
command(*args).run
cmd = command(*args)
cmd.validate!
cmd.run
config.silent = config_silent
Pod::UI.output
end
......
......@@ -28,7 +28,7 @@ module SpecHelper
end
def add_repo(name, from)
command = command('repo', 'add', name, from)
command = Pod::Command.parse(['repo', 'add', name, from])
command.run
# The test branch is used by the push specs
Dir.chdir(command.dir) do
......
require File.expand_path('../../spec_helper', __FILE__)
describe "Pod::Command" do
it "returns the proper command class" do
Pod::Command.parse('setup').should.be.instance_of Pod::Command::Setup
Pod::Command.parse('spec', 'create', 'name').should.be.instance_of Pod::Command::Spec
Pod::Command.parse('repo', 'update').should.be.instance_of Pod::Command::Repo
module Pod
describe Command do
it "returns the proper command class" do
Command.parse(%w{ install }).should.be.instance_of Command::Install
Command.parse(%w{ list }).should.be.instance_of Command::List
Command.parse(%w{ outdated }).should.be.instance_of Command::Outdated
Command.parse(%w{ push }).should.be.instance_of Command::Push
Command.parse(%w{ repo }).should.be.instance_of Command::Repo
Command.parse(%w{ repo add }).should.be.instance_of Command::Repo::Add
Command.parse(%w{ repo lint }).should.be.instance_of Command::Repo::Lint
Command.parse(%w{ repo update }).should.be.instance_of Command::Repo::Update
Command.parse(%w{ search }).should.be.instance_of Command::Search
Command.parse(%w{ setup }).should.be.instance_of Command::Setup
Command.parse(%w{ spec create }).should.be.instance_of Command::Spec::Create
Command.parse(%w{ spec lint }).should.be.instance_of Command::Spec::Lint
Command.parse(%w{ repo update }).should.be.instance_of Command::Repo::Update
end
end
end
describe "Pod::Command::Repo" do
it "complains about unknown arguments" do
lambda { Pod::Command::Repo.new(argv('something')) }.should.raise Pod::Command::Help
end
end
......@@ -14,9 +14,9 @@ module Pod
it "holds the context state, such as cached specification sets" do
@resolver.resolve
@resolver.cached_sets.values.sort_by(&:name).should == [
Pod::Source.search_by_name('A2DynamicDelegate').first,
Pod::Source.search_by_name('BlocksKit').first,
Pod::Source.search_by_name('libffi').first
Source.search_by_name('A2DynamicDelegate').first,
Source.search_by_name('BlocksKit').first,
Source.search_by_name('libffi').first
].sort_by(&:name)
end
......@@ -34,7 +34,7 @@ module Pod
end
it "raises once any of the dependencies does not match the platform of its podfile target" do
set = Pod::Source.search_by_name('BlocksKit').first
set = Source.search_by_name('BlocksKit').first
@resolver.cached_sets['BlocksKit'] = set
def set.stub_platform=(platform); @stubbed_platform = platform; end
......@@ -54,7 +54,7 @@ module Pod
end
it "raises once any of the dependencies does not have a deployment_target compatible with its podfile target" do
set = Pod::Source.search_by_name('BlocksKit').first
set = Source.search_by_name('BlocksKit').first
@resolver.cached_sets['BlocksKit'] = set
@podfile.platform :ios, "4.0"
......@@ -200,7 +200,7 @@ module Pod
pod 'JSONKit', "1.5pre"
end
resolver = Resolver.new(podfile, nil, stub('sandbox'))
lambda {resolver.resolve}.should.raise Pod::Informative
lambda {resolver.resolve}.should.raise Informative
end
describe "Concerning Installation mode" do
......@@ -212,11 +212,11 @@ module Pod
pod 'JSONKit'
end
@specs = [
Pod::Specification.new do |s|
Specification.new do |s|
s.name = "BlocksKit"
s.version = "1.0.0"
end,
Pod::Specification.new do |s|
Specification.new do |s|
s.name = "JSONKit"
s.version = "1.4"
end ]
......@@ -300,7 +300,7 @@ module Pod
pod 'JSONKit'
end
config.skip_repo_update = false
Pod::Command::Repo.any_instance.expects(:run).never
Command::Repo.any_instance.expects(:run).never
@resolver = Resolver.new(podfile, @lockfile, stub('sandbox'))
@resolver.resolve
end
......@@ -313,7 +313,7 @@ module Pod
pod 'libPusher' # New pod
end
config.skip_repo_update = false
Pod::Command::Repo.any_instance.expects(:run).once
Command::Repo::Update.any_instance.expects(:run).once
@resolver = Resolver.new(podfile, @lockfile, stub('sandbox'))
@resolver.resolve
end
......@@ -326,7 +326,7 @@ module Pod
pod 'libPusher' # New pod
end
config.skip_repo_update = true
Pod::Command::Repo.any_instance.expects(:run).never
Command::Repo::Update.any_instance.expects(:run).never
@resolver = Resolver.new(podfile, @lockfile, stub('sandbox'))
@resolver.resolve
end
......@@ -338,7 +338,7 @@ module Pod
pod 'JSONKit', :head #changed to head
end
config.skip_repo_update = false
Pod::Command::Repo.any_instance.expects(:run).once
Command::Repo::Update.any_instance.expects(:run).once
@resolver = Resolver.new(podfile, @lockfile, stub('sandbox'))
@resolver.resolve
end
......@@ -354,11 +354,11 @@ module Pod
pod 'libPusher'
end
@specs = [
Pod::Specification.new do |s|
Specification.new do |s|
s.name = "libPusher"
s.version = "1.3"
end,
Pod::Specification.new do |s|
Specification.new do |s|
s.name = "JSONKit"
s.version = "1.4"
end ]
......@@ -411,7 +411,7 @@ module Pod
pod 'libPusher'
end
config.skip_repo_update = false
Pod::Command::Repo.any_instance.expects(:run).once
Command::Repo::Update.any_instance.expects(:run).once
@resolver = Resolver.new(podfile, @lockfile, stub('sandbox'))
@resolver.update_mode = true
@resolver.resolve
......
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