Sha256: 42e3e5fcf093abef53b64c813971318edd7048f5b519c71b60080a06a64a574c

Contents?: true

Size: 738 Bytes

Versions: 1

Compression:

Stored size: 738 Bytes

Contents

# frozen_string_literal: true
require 'spec_helper'

describe BitBucket do
  let(:method) { 'create_repos' }
  let(:alt_method) { 'repos.create' }

  it { expect(described_class.constants).to include :DEPRECATION_PREFIX }

  context '.deprecate' do
    before do
      BitBucket.deprecation_tracker = []
    end

    it 'tracks messages' do
      expect(BitBucket).to receive(:warn).once
      BitBucket.deprecate(method)
      BitBucket.deprecate(method)
    end

    it 'prints the message through Kernel' do
      expect(BitBucket).to receive(:warn).once
      BitBucket.deprecate method
    end
  end

  it 'prints the message through Kernel' do
    expect(BitBucket).to receive(:warn)
    BitBucket.warn_deprecation method
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bitbuckets-0.2.0 spec/bitbucket_rest_api/deprecation_spec.rb