Sha256: 936b0a6190fc91eb0e6b471d3b8081bc2fa617722503c503b3be26a0d4525d54

Contents?: true

Size: 1.16 KB

Versions: 5

Compression:

Stored size: 1.16 KB

Contents

require 'spec_helper'

describe BitBucket::Repos::Changesets do
  let(:changesets) { BitBucket::Repos::Changesets.new }

  describe '.list' do
    before do
      expect(changesets).to receive(:request).with(
        :get,
        '/1.0/repositories/mock_username/mock_repo/changesets',
        {},
        {}
      ).and_return(['changset1', 'changeset2', 'changeset3'])
    end

    context 'without a block' do
      it 'should send a GET request for the changesets belonging to the given repo' do
        changesets.list('mock_username', 'mock_repo')
      end
    end

    context 'with a block' do
      it 'should send a GET request for the changesets belonging to the given repo' do
        changesets.list('mock_username', 'mock_repo') { |changeset| changeset }
      end
    end
  end

  describe '.get' do
    before do
      expect(changesets).to receive(:request).with(
        :get,
        '/1.0/repositories/mock_username/mock_repo/changesets/test_sha',
        {},
        {}
      )
    end

    it 'should send a GET request for a particular changeset belonging to the given repo' do
      changesets.get('mock_username', 'mock_repo', 'test_sha')
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
zz_bitbucket_rest_api-0.1.11 spec/bitbucket_rest_api/repos/changesets_spec.rb
zz_bitbucket_rest_api-0.1.10 spec/bitbucket_rest_api/repos/changesets_spec.rb
zz_bitbucket_rest_api-0.1.9 spec/bitbucket_rest_api/repos/changesets_spec.rb
zz_bitbucket_rest_api-0.1.8 spec/bitbucket_rest_api/repos/changesets_spec.rb
bitbucket_rest_api2-0.9.5 spec/bitbucket_rest_api/repos/changesets_spec.rb