Permalink
Browse files

Merge pull request #103 from willrax/delete_repo

Added delete_repository
  • Loading branch information...
2 parents 8b961b5 + 63d9373 commit 9508593ed50676e467127a3b7faf60d8485c8cb2 @sferik sferik committed Jun 16, 2012
Showing with 16 additions and 0 deletions.
  1. +5 −0 lib/octokit/client/repositories.rb
  2. +11 −0 spec/octokit/client/repositories_spec.rb
@@ -54,6 +54,11 @@ def create_repository(name, options={})
alias :create_repo :create_repository
alias :create :create_repository
+ def delete_repository(repo, options={})
+ delete "/repos/#{Repository.new repo}", options, 3
+ end
+ alias :delete_repo :delete_repository
+
def set_private(repo, options={})
update_repository repo, options.merge({ :private => true })
end
@@ -120,6 +120,17 @@
end
+ describe ".delete_repository" do
+
+ it "should delete a repository" do
+ stub_delete("/repos/sferik/rails_admin").
+ to_return(:status => 204, :body => "")
+ result = @client.delete_repository("sferik/rails_admin")
+ result.should be_nil
+ end
+
+ end
+
describe ".set_private" do
it "should set a repository private" do

0 comments on commit 9508593

Please sign in to comment.