Sha256: dac2a435345d2052166e4a74c318975822c898672f51cdbc574a18181ab66bae

Contents?: true

Size: 1.16 KB

Versions: 4

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,
        '/2.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,
        '/2.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

4 entries across 4 versions & 1 rubygems

Version Path
bitbucket_rest_api2-0.9.1 spec/bitbucket_rest_api/repos/changesets_spec.rb
bitbucket_rest_api2-0.2.2 spec/bitbucket_rest_api/repos/changesets_spec.rb
bitbucket_rest_api2-0.2.1 spec/bitbucket_rest_api/repos/changesets_spec.rb
bitbucket_rest_api2-0.2.0 spec/bitbucket_rest_api/repos/changesets_spec.rb