Sha256: 2631c992bcd79237f646270d2023d1312eb8eb5b9dd44c7986f69196ba12aa65

Contents?: true

Size: 1015 Bytes

Versions: 26

Compression:

Stored size: 1015 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Github::Repos, '#delete' do
  let(:user) { 'peter-murach' }
  let(:repo) { 'github' }
  let(:request_path) { "/repos/#{user}/#{repo}" }
  let(:body) { '' }
  let(:status) { 204 }

  before {
    stub_delete(request_path).to_return(:body => body, :status => status,
      :headers => { :content_type => "application/json; charset=utf-8"})
  }

  after { reset_authentication_for subject }

  it { should respond_to :remove }

  it "should delete the resource successfully" do
    subject.delete user, repo
    a_delete(request_path).should have_been_made
  end

  it "should fail to delete resource without 'user' parameter" do
    expect { subject.delete nil, repo }.to raise_error(ArgumentError)
  end

  it "should fail to delete resource without 'repo' parameter" do
    expect { subject.delete user, nil }.to raise_error(ArgumentError)
  end

  it_should_behave_like 'request failure' do
    let(:requestable) { subject.delete user, repo }
  end

end # delete

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
github_api-0.8.6 spec/github/repos/delete_spec.rb
github_api-0.8.5 spec/github/repos/delete_spec.rb
github_api-0.8.4 spec/github/repos/delete_spec.rb
github_api-0.8.3 spec/github/repos/delete_spec.rb
github_api-0.8.2 spec/github/repos/delete_spec.rb
github_api-0.8.1 spec/github/repos/delete_spec.rb