Commit 502432ab authored by Fabio Pelosin's avatar Fabio Pelosin

[fixed] specs

parent 915bcd8e
---
JSGCDDispatcher:
:creation_date: 2011-09-27 04:50:32 +02:00
PINView:
:creation_date: 2011-12-30 15:44:26 +01:00
TBXML:
:creation_date: 2011-12-18 15:06:29 +01:00
SFHFKeychainUtils:
:creation_date: 2011-11-20 00:33:47 +01:00
Specta:
:creation_date: 2012-01-09 10:44:32 +01:00
TouchJSON:
:creation_date: 2011-12-08 16:01:01 +01:00
FileMD5Hash:
:creation_date: 2012-01-30 15:11:42 +01:00
LibComponentLogging-NSLog:
:creation_date: 2011-10-02 22:48:25 +02:00
NSLogger-CocoaLumberjack-connector:
:creation_date: 2011-11-15 19:05:42 +01:00
LRResty:
:creation_date: 2011-09-21 01:45:03 +02:00
A2DynamicDelegate:
:creation_date: 2011-12-18 13:52:48 +01:00
CocoaAsyncSocket:
:creation_date: 2011-11-22 11:53:58 +01:00
MBProgressHUD:
:creation_date: 2012-01-27 12:41:28 +01:00
SDWebImage:
:creation_date: 2011-11-15 23:11:49 +01:00
A2StoryboardSegueContext:
:creation_date: 2011-12-23 05:40:29 +01:00
MKNetworkKit:
:creation_date: 2011-12-14 18:21:33 +01:00
TTTAttributedLabel:
:creation_date: 2011-09-18 22:31:14 +02:00
libPusher:
:creation_date: 2012-02-01 17:05:58 +01:00
INAppStoreWindow:
:creation_date: 2011-11-16 20:21:35 +01:00
MTLocation:
:creation_date: 2011-11-10 20:28:01 +01:00
LRMocky:
:creation_date: 2011-09-21 02:34:18 +02:00
ConciseKit:
:creation_date: 2012-01-09 00:32:07 +01:00
KKGridView:
:creation_date: 2011-11-21 12:27:34 +01:00
MagicalRecord:
:creation_date: 2011-11-22 23:51:22 +01:00
IMAPClient:
:creation_date: 2012-01-01 22:09:28 +01:00
HockeySDK:
:creation_date: 2011-12-29 11:50:23 +01:00
MGSplitViewController:
:creation_date: 2011-09-20 23:01:04 +02:00
INKeychainAccess:
:creation_date: 2011-11-26 23:44:48 +01:00
Expecta:
:creation_date: 2012-01-09 00:32:07 +01:00
iCarousel:
:creation_date: 2012-02-03 11:48:41 +01:00
SSKeychain:
:creation_date: 2011-09-18 17:23:10 +02:00
NLCoreData:
:creation_date: 2012-01-25 10:14:35 +01:00
ASIHTTPRequest:
:creation_date: 2011-09-08 21:46:11 +02:00
ZBarSDK:
:creation_date: 2011-11-19 23:12:38 +01:00
ASIWebPageRequest:
:creation_date: 2011-09-08 21:46:11 +02:00
SBJson:
:creation_date: 2011-09-23 19:41:42 +02:00
QuickDialog:
:creation_date: 2011-11-22 21:59:44 +01:00
AFNetworking:
:creation_date: 2011-09-18 21:02:31 +02:00
JSONKit:
:creation_date: 2011-09-12 10:49:04 +02:00
iRate:
:creation_date: 2012-01-29 22:19:19 +01:00
SSToolkit:
:creation_date: 2011-10-20 23:00:07 +02:00
BlocksKit:
:creation_date: 2011-11-01 11:29:58 +01:00
SSCheckBoxView:
:creation_date: 2012-01-31 18:11:35 +01:00
HockeyKit:
:creation_date: 2011-11-21 16:02:33 +01:00
FormatterKit:
:creation_date: 2011-09-18 22:31:14 +02:00
MTZoomWindow:
:creation_date: 2011-11-10 20:06:44 +01:00
RestKit:
:creation_date: 2011-10-02 22:48:25 +02:00
cocoa-oauth:
:creation_date: 2012-01-30 15:11:42 +01:00
Facebook-iOS-SDK:
:creation_date: 2011-12-15 20:09:29 +01:00
Appirater:
:creation_date: 2011-11-20 00:16:39 +01:00
EGOCache:
:creation_date: 2012-01-04 11:03:53 +01:00
OCHamcrest:
:creation_date: 2012-01-10 16:01:28 +01:00
OCMock:
:creation_date: 2011-11-27 01:53:12 +01:00
FMDB:
:creation_date: 2011-09-25 02:44:00 +02:00
Kiwi:
:creation_date: 2011-09-19 19:55:46 +02:00
PullToRefresh:
:creation_date: 2011-11-20 00:21:00 +01:00
Nimbus:
:creation_date: 2011-11-23 23:15:47 +01:00
Objection:
:creation_date: 2011-09-19 19:14:56 +02:00
NSLogger:
:creation_date: 2011-11-15 17:37:36 +01:00
MTStatusBarOverlay:
:creation_date: 2011-11-10 21:00:26 +01:00
SVProgressHUD:
:creation_date: 2011-11-15 21:55:28 +01:00
EGOTableViewPullRefresh:
:creation_date: 2011-11-13 18:08:37 +01:00
SOCKit:
:creation_date: 2012-01-30 15:11:42 +01:00
KKPasscodeLock:
:creation_date: 2012-01-30 15:55:19 +01:00
PSStackedView:
:creation_date: 2011-11-13 11:03:12 +01:00
QuincyKit:
:creation_date: 2011-11-21 23:42:35 +01:00
DCTTextFieldValidator:
:creation_date: 2011-11-16 00:55:06 +01:00
RegexKitLite:
:creation_date: 2011-12-13 13:46:45 +01:00
TouchXML:
:creation_date: 2011-12-07 16:55:17 +01:00
Reachability:
:creation_date: 2011-09-08 21:46:11 +02:00
SDURLCache:
:creation_date: 2011-09-25 21:14:43 +02:00
LibComponentLogging-Core:
:creation_date: 2011-10-02 22:48:25 +02:00
ATMHud:
:creation_date: 2011-11-19 23:53:38 +01:00
CocoaLumberjack:
:creation_date: 2011-10-06 17:37:56 +02:00
SSZipArchive:
:creation_date: 2011-09-11 15:45:34 +02:00
...@@ -13,35 +13,38 @@ describe "Pod::Command::List" do ...@@ -13,35 +13,38 @@ describe "Pod::Command::List" do
def command(arguments = argv) def command(arguments = argv)
command = Pod::Command::List.new(arguments) command = Pod::Command::List.new(arguments)
def command.puts(msg = '')
(@printed ||= '') << "#{msg}\n"
end
command
end end
it "it accepts corret inputs and runs without errors" do it "runs with correct parameters" do
lambda { command().run }.should.not.raise lambda { command.run }.should.not.raise
lambda { command(argv('10')).run }.should.not.raise lambda { command(argv('new')).run }.should.not.raise
end end
it "complains if the days parameter is not a number" do it "complains for wrong parameters" do
lambda { command(argv('10a')).run }.should.raise Pod::Command::Help lambda { command(argv('wrong')).run }.should.raise Pod::Command::Help
lambda { command(argv('--wrong')).run }.should.raise Pod::Command::Help
end end
it "presents the known pods" do
it "returns the specs know in a given commit" do list = command()
specs = command(argv('10')).spec_names_from_commit('cad98852103394951850f89f0efde08f9dc41830') list.run
specs[00].should == 'A2DynamicDelegate' output = list.output
specs[10].should == 'DCTTextFieldValidator' output.should.include 'ZBarSDK'
specs[20].should == 'INKeychainAccess' output.should.include 'TouchJSON'
specs[30].should == 'MKNetworkKit' output.should.include 'SDURLCache'
output.should.include 'MagicalRecord'
output.should.include 'A2DynamicDelegate'
output.should.include '75 pods were found'
end end
it "returns the new specs introduced after a given commit" do it "returns the new pods" do
new_specs = command(argv('10')).new_specs_set('1c138d254bd39a3ccbe95a720098e2aaad5c5fc1') Time.stubs(:now).returns(Time.mktime(2012,2,1))
new_specs_name = new_specs.map { |spec| spec.name } list = command(argv('new'))
new_specs_name.should.include 'iCarousel' list.run
new_specs_name.should.include 'libPusher' output = list.output
output.should.include 'iCarousel'
output.should.include 'cocoa-oauth'
output.should.include 'NLCoreData'
end end
end end
......
require File.expand_path('../../../spec_helper', __FILE__) require File.expand_path('../../../spec_helper', __FILE__)
require 'net/http' require 'net/http'
describe Pod::Command::SetPresent do describe Pod::Command::Presenter do
Presenter = Pod::Command::Presenter
before do before do
@set = Pod::Spec::Set.new(fixture('spec-repos/master/CocoaLumberjack')) @set = Pod::Spec::Set.new(fixture('spec-repos/master/CocoaLumberjack'))
@dummy = Object.new Pod::Specification::Statistics.instance.cache_file = nil
@dummy.extend(Pod::Command::SetPresent)
def @dummy.puts(msg = '') (@printed ||= '') << "#{msg}\n" end
def @dummy.prinded() @printed.chomp end
end
it "repects the `--name-only' option" do
@dummy.parse_set_options(argv('--name-only'))
@dummy.present_set(@set)
@dummy.prinded.should == 'CocoaLumberjack'
end end
it "presents the name, version, description, homepage and source of a specification set" do it "presents the name, version, description, homepage and source of a specification set" do
@dummy.parse_set_options(argv()) presenter = Presenter.new(argv())
@dummy.present_set(@set) output = presenter.render_set(@set)
@dummy.prinded.should.include? 'CocoaLumberjack' output.should.include? 'CocoaLumberjack'
@dummy.prinded.should.include? '1.0' output.should.include? '1.0'
@dummy.prinded.should.include? '1.1' output.should.include? '1.1'
@dummy.prinded.should.include? 'A fast & simple, yet powerful & flexible logging framework for Mac and iOS.' output.should.include? 'A fast & simple, yet powerful & flexible logging framework for Mac and iOS.'
@dummy.prinded.should.include? 'https://github.com/robbiehanson/CocoaLumberjack' output.should.include? 'https://github.com/robbiehanson/CocoaLumberjack'
@dummy.prinded.should.include? 'https://github.com/robbiehanson/CocoaLumberjack.git' output.should.include? 'https://github.com/robbiehanson/CocoaLumberjack.git'
end end
it "presents the stats of a specification set" do it "presents the stats of a specification set" do
response = '{"repository":{"homepage":"","url":"https://github.com/robbiehanson/CocoaLumberjack","has_downloads":true,"has_issues":true,"language":"Objective-C","master_branch":"master","forks":42,"fork":false,"created_at":"2011/03/30 19:38:39 -0700","has_wiki":true,"description":"A fast & simple, yet powerful & flexible logging framework for Mac and iOS","size":416,"private":false,"name":"CocoaLumberjack","owner":"robbiehanson","open_issues":4,"watchers":318,"pushed_at":"2012/03/26 12:39:36 -0700"}}% ' response = '{"repository":{"homepage":"","url":"https://github.com/robbiehanson/CocoaLumberjack","has_downloads":true,"has_issues":true,"language":"Objective-C","master_branch":"master","forks":42,"fork":false,"created_at":"2011/03/30 19:38:39 -0700","has_wiki":true,"description":"A fast & simple, yet powerful & flexible logging framework for Mac and iOS","size":416,"private":false,"name":"CocoaLumberjack","owner":"robbiehanson","open_issues":4,"watchers":318,"pushed_at":"2012/03/26 12:39:36 -0700"}}% '
Net::HTTP.expects(:get).with('github.com', '/api/v2/json/repos/show/robbiehanson/CocoaLumberjack').returns(response) Net::HTTP.expects(:get).with('github.com', '/api/v2/json/repos/show/robbiehanson/CocoaLumberjack').returns(response)
@dummy.parse_set_options(argv('--stats')) presenter = Presenter.new(argv('--stats'))
@dummy.present_set(@set) output = presenter.render_set(@set)
@dummy.prinded.should.match(/Watchers:\W+[0-9]+/) output.should.include? 'License: BSD'
@dummy.prinded.should.match(/Forks:\W+[0-9]+/) output.should.include? 'Platform: iOS - OS X'
output.should.include? 'Watchers: 318'
output.should.include? 'Forks: 318'
end end
end end
......
require File.expand_path('../../../spec_helper', __FILE__)
describe "Pod::Command::Search" do
extend SpecHelper::Git
before do
config.repos_dir = fixture('spec-repos')
end
after do
config.repos_dir = tmp_repos_path
end
def command(arguments = argv)
command = Pod::Command::Search.new(arguments)
end
it "runs with correct parameters" do
lambda { command(argv('table')).run }.should.not.raise
lambda { command(argv('table','--full')).run }.should.not.raise
end
it "complains for wrong parameters" do
lambda { command(argv('too','many')).run }.should.raise Pod::Command::Help
lambda { command(argv('too','--wrong')).run }.should.raise Pod::Command::Help
lambda { command(argv('--missing_query')).run }.should.raise Pod::Command::Help
end
it "presents the search results" do
search = command(argv('table'))
search.run
output = search.output
output.should.include 'EGOTableViewPullRefresh'
end
end
...@@ -66,3 +66,11 @@ VCR.configure do |c| ...@@ -66,3 +66,11 @@ VCR.configure do |c|
c.hook_into :webmock # or :fakeweb c.hook_into :webmock # or :fakeweb
c.allow_http_connections_when_no_cassette = true c.allow_http_connections_when_no_cassette = true
end end
class Pod::Command
attr_accessor :output
def puts(msg = '') (@output ||= '') << "#{msg}\n" end
end
Pod::Specification::Statistics.instance.cache_file = nil
...@@ -10,15 +10,15 @@ module SpecHelper ...@@ -10,15 +10,15 @@ module SpecHelper
ROOT + 'tmp' ROOT + 'tmp'
end end
module_function :temporary_directory module_function :temporary_directory
def setup_temporary_directory def setup_temporary_directory
temporary_directory.mkpath temporary_directory.mkpath
end end
def teardown_temporary_directory def teardown_temporary_directory
temporary_directory.rmtree if temporary_directory.exist? temporary_directory.rmtree if temporary_directory.exist?
end end
def self.extended(base) def self.extended(base)
base.before do base.before do
teardown_temporary_directory teardown_temporary_directory
......
...@@ -4,23 +4,25 @@ describe "Pod::Platform" do ...@@ -4,23 +4,25 @@ describe "Pod::Platform" do
before do before do
@platform = Pod::Platform.new(:ios) @platform = Pod::Platform.new(:ios)
end end
it "exposes it's symbolic name" do it "exposes it's symbolic name" do
@platform.name.should == :ios @platform.name.should == :ios
end end
it "can be compared for equality with another platform with the same symbolic name" do it "can be compared for equality with another platform with the same symbolic name" do
@platform.should == Pod::Platform.new(:ios) @platform.should == Pod::Platform.new(:ios)
end end
it "can be compared for equality with a matching symbolic name (backwards compatibility reasons)" do it "can be compared for equality with a matching symbolic name (backwards compatibility reasons)" do
@platform.should == :ios @platform.should == :ios
end end
it "uses it's name as it's string version" do it "presents an accurate string representation" do
@platform.to_s.should == "ios" @platform.to_s.should == "iOS"
Pod::Platform.new(:osx).to_s.should == 'OS X'
Pod::Platform.new(nil).to_s.should == "iOS - OS X"
end end
it "uses it's name as it's symbold version" do it "uses it's name as it's symbold version" do
@platform.to_sym.should == :ios @platform.to_sym.should == :ios
end end
...@@ -30,7 +32,7 @@ describe "Pod::Platform with a nil value" do ...@@ -30,7 +32,7 @@ describe "Pod::Platform with a nil value" do
before do before do
@platform = Pod::Platform.new(nil) @platform = Pod::Platform.new(nil)
end end
it "behaves like a nil object" do it "behaves like a nil object" do
@platform.should.be.nil @platform.should.be.nil
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