Sha256: 55332e31dd56cf4cd04867f9ea50d875e96cbcb376679e8cf706a0a10fad488d

Contents?: true

Size: 1010 Bytes

Versions: 14

Compression:

Stored size: 1010 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Github::Repos::Contents, '#get' do
  let(:user) { 'peter-murach' }
  let(:repo) { 'github' }
  let(:request_path) { "/repos/#{user}/#{repo}/#{archive_format}/#{ref}" }

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

  after { reset_authentication_for(subject) }

  let(:archive_format) { 'tarball' }
  let(:ref) { 'master' }
  let(:body) { '[]' }
  let(:status) { 302 }


  it "should get the resources" do
    subject.archive user, repo, :archive_format => archive_format, :ref => ref
    a_get(request_path).should have_been_made
  end

  context 'with defaults' do
    let(:request_path) { "/repos/#{user}/#{repo}/zipball/master" }

    it { expect { subject.archive user }.to raise_error(ArgumentError) }

    it 'should get the resource' do
      subject.archive user, repo
      a_get(request_path).should have_been_made
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
github_api-0.11.3 spec/github/repos/contents/archive_spec.rb
github_api-0.11.2 spec/github/repos/contents/archive_spec.rb
github_api-0.11.1 spec/github/repos/contents/archive_spec.rb
github_api-0.11.0 spec/github/repos/contents/archive_spec.rb
github_api-0.10.2 spec/github/repos/contents/archive_spec.rb
github_api-0.10.1 spec/github/repos/contents/archive_spec.rb
github_api-0.10.0 spec/github/repos/contents/archive_spec.rb
github_api-0.9.7 spec/github/repos/contents/archive_spec.rb
github_api-0.9.6 spec/github/repos/contents/archive_spec.rb
github_api-0.9.5 spec/github/repos/contents/archive_spec.rb
github_api-0.9.4 spec/github/repos/contents/archive_spec.rb
github_api-0.9.3 spec/github/repos/contents/archive_spec.rb
github_api-0.9.2 spec/github/repos/contents/archive_spec.rb
github_api-0.9.1 spec/github/repos/contents/archive_spec.rb