Sha256: cbc8c5a3888a6af938e8423ac1ef4a2469cb1c0db97526732c191e5408fc71a3

Contents?: true

Size: 694 Bytes

Versions: 2

Compression:

Stored size: 694 Bytes

Contents

require 'spec_helper'

describe LinkShrink do
  include_examples 'shared_examples'

  before :all do
    LinkShrink.configure { |c| c.api = 'Google' }
  end

  describe '.shrink_url', :vcr => 'google_url' do
    it 'creates a short url' do
      expect(link_shrink.shrink_url(url)).to eq(short_url)
    end
  end

  describe '.configure' do
    context 'when passed a block' do
      it 'yields to Config' do
        expect { |c| link_shrink.configure(&c) }.to yield_control
      end

      it 'sets API Shrinker' do
        link_shrink.should_receive(:configure)
          .and_yield(LinkShrink::Config)

        link_shrink.configure { |config| api = 'TinyURL' }
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
link_shrink-0.0.8 spec/link_shrink/link_shrink_spec.rb
link_shrink-0.0.7 spec/link_shrink/link_shrink_spec.rb