Sha256: 111a48e166b36ba27ebfbc331e0933f4d2d3a7ea6688d3ea62d1a155daf0e593

Contents?: true

Size: 797 Bytes

Versions: 5

Compression:

Stored size: 797 Bytes

Contents

require 'spec_helper'

describe Waddup::Source do

  describe '#events' do
    it 'has to be implemented by subclass' do
      expect do
        subject.events nil, nil
      end.to raise_error NotImplementedError
    end
  end

  describe '#usable?' do
    it 'delegates for convenience' do
      expect(described_class).to receive :usable?
      subject.usable?
    end
  end

  describe '::usable?' do
    it 'has to be implemented by subclass' do
      expect do
        described_class.usable?
      end.to raise_error NotImplementedError
    end
  end

  describe '::usable' do
    it 'retrieves usable sources' do
      described_class.registry.each do |source|
        source.stub(:usable?).and_return true
      end

      expect(described_class.usable).to be_an Array
    end
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
waddup-0.2.2 spec/waddup/source_spec.rb
waddup-0.2.1 spec/waddup/source_spec.rb
waddup-0.2.0 spec/waddup/source_spec.rb
waddup-0.1.0 spec/waddup/source_spec.rb
waddup-0.0.2 spec/waddup/source_spec.rb