octopi 0.1.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -1
- data/.yardoc +0 -0
- data/README.rdoc +16 -41
- data/Rakefile +9 -0
- data/VERSION.yml +2 -2
- data/examples/overall.rb +1 -1
- data/lib/ext/hash_ext.rb +5 -0
- data/lib/ext/string_ext.rb +5 -0
- data/lib/octopi.rb +101 -202
- data/lib/octopi/api.rb +209 -0
- data/lib/octopi/base.rb +42 -38
- data/lib/octopi/blob.rb +12 -8
- data/lib/octopi/branch.rb +20 -7
- data/lib/octopi/branch_set.rb +11 -0
- data/lib/octopi/comment.rb +20 -0
- data/lib/octopi/commit.rb +39 -35
- data/lib/octopi/error.rb +17 -5
- data/lib/octopi/file_object.rb +6 -5
- data/lib/octopi/gist.rb +28 -0
- data/lib/octopi/issue.rb +49 -40
- data/lib/octopi/issue_comment.rb +7 -0
- data/lib/octopi/issue_set.rb +21 -0
- data/lib/octopi/key.rb +14 -7
- data/lib/octopi/key_set.rb +14 -0
- data/lib/octopi/plan.rb +5 -0
- data/lib/octopi/repository.rb +66 -45
- data/lib/octopi/repository_set.rb +9 -0
- data/lib/octopi/resource.rb +11 -16
- data/lib/octopi/self.rb +33 -0
- data/lib/octopi/tag.rb +12 -6
- data/lib/octopi/user.rb +62 -38
- data/octopi.gemspec +43 -12
- data/test/api_test.rb +58 -0
- data/test/authenticated_test.rb +39 -0
- data/test/blob_test.rb +23 -0
- data/test/branch_test.rb +20 -0
- data/test/commit_test.rb +82 -0
- data/test/file_object_test.rb +39 -0
- data/test/gist_test.rb +16 -0
- data/test/issue_comment.rb +19 -0
- data/test/issue_set_test.rb +33 -0
- data/test/issue_test.rb +120 -0
- data/test/key_set_test.rb +29 -0
- data/test/key_test.rb +35 -0
- data/test/repository_set_test.rb +23 -0
- data/test/repository_test.rb +141 -0
- data/test/stubs/commits/fcoury/octopi/octopi.rb +818 -0
- data/test/tag_test.rb +20 -0
- data/test/test_helper.rb +236 -0
- data/test/user_test.rb +92 -0
- metadata +54 -12
- data/examples/github.yml.example +0 -14
- data/test/octopi_test.rb +0 -46
data/examples/github.yml.example
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Octopi GitHub API configuration file
|
3
|
-
#
|
4
|
-
|
5
|
-
# GitHub user login and token
|
6
|
-
login: github-username
|
7
|
-
token: github-token
|
8
|
-
|
9
|
-
# Trace level
|
10
|
-
# Possible values:
|
11
|
-
# false - no tracing, same as if the param is ommited
|
12
|
-
# true - will output each POST or GET operation to the stdout
|
13
|
-
# curl - same as true, but in addition will output the curl equivalent of each command (for debugging)
|
14
|
-
trace: curl
|
data/test/octopi_test.rb
DELETED
@@ -1,46 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class OctopiTest < Test::Unit::TestCase
|
4
|
-
include Octopi
|
5
|
-
|
6
|
-
# TODO: Those tests are obviously brittle. Need to stub/mock it.
|
7
|
-
|
8
|
-
def assert_find_all(cls, check_method, repo, user)
|
9
|
-
repo_method = cls.resource_name(:plural)
|
10
|
-
|
11
|
-
item1 = cls.find_all(repo.name,user.login).first
|
12
|
-
item2 = cls.find_all(repo).first
|
13
|
-
item3 = repo.send(repo_method).first
|
14
|
-
|
15
|
-
assert_equal item1.send(check_method), item2.send(check_method)
|
16
|
-
assert_equal item1.send(check_method), item3.send(check_method)
|
17
|
-
end
|
18
|
-
|
19
|
-
def setup
|
20
|
-
@user = User.find("fcoury")
|
21
|
-
@repo = @user.repository("octopi")
|
22
|
-
@issue = @repo.issues.first
|
23
|
-
end
|
24
|
-
|
25
|
-
context Issue do
|
26
|
-
should "return the correct issue by number" do
|
27
|
-
assert_equal @issue.number, Issue.find(@repo, @issue.number).number
|
28
|
-
assert_equal @issue.number, Issue.find(@user, @repo, @issue.number).number
|
29
|
-
assert_equal @issue.number, Issue.find(@repo.owner, @repo.name, @issue.number).number
|
30
|
-
end
|
31
|
-
|
32
|
-
should "return the correct issue by using repo.issue number" do
|
33
|
-
assert_equal @issue.number, @repo.issue(@issue.number).number
|
34
|
-
end
|
35
|
-
|
36
|
-
should "fetch the same issue using different but equivalent find_all params" do
|
37
|
-
assert_find_all Issue, :number, @repo, @user
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
context Commit do
|
42
|
-
should "fetch the same commit using different but equivalent find_all params" do
|
43
|
-
assert_find_all Commit, :id, @repo, @user
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|