-
Notifications
You must be signed in to change notification settings - Fork 340
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP][GitHub] Port Octokit functionality from CocoaPods
- Loading branch information
1 parent
236a546
commit eece21b
Showing
2 changed files
with
88 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
require File.expand_path('../spec_helper', __FILE__) | ||
|
||
module Pod | ||
describe GitHub do | ||
|
||
describe "In general" do | ||
it "returns the information of a user" do | ||
user = GitHub.user("CocoaPods") | ||
user['login'].should == 'CocoaPods' | ||
end | ||
|
||
it "returns the information of a repo" do | ||
repo = GitHub.fetch_github_repo_data("https://github.com/CocoaPods/CocoaPods") | ||
repo['name'].should == 'CocoaPods' | ||
end | ||
|
||
it "returns the tags of a repo" do | ||
tags = GitHub.tags("https://github.com/CocoaPods/CocoaPods") | ||
tags.find { |t| t["name"] == "0.20.2" }.should.not.be.nil | ||
end | ||
|
||
it "returns the branches of a repo" do | ||
branches = GitHub.branches("https://github.com/CocoaPods/CocoaPods") | ||
branches.find { |t| t["name"] == "master" }.should.not.be.nil | ||
end | ||
end | ||
|
||
#-------------------------------------------------------------------------# | ||
|
||
describe "Private helpers" do | ||
|
||
it "returns the repo id from a given github URL" do | ||
id = GitHub.send(:repo_id_from_url, "https://github.com/CocoaPods/CocoaPods") | ||
id.should == "CocoaPods/CocoaPods" | ||
end | ||
|
||
end | ||
|
||
#-------------------------------------------------------------------------# | ||
|
||
end | ||
end |