Sha256: 9e985f5d3e7be166761058baf74f8ec13f0a8ff049b7d58ecc6286003e244e74

Contents?: true

Size: 1.14 KB

Versions: 6

Compression:

Stored size: 1.14 KB

Contents

require 'spec_helper'

describe Pushbullet::Channel do
  describe '::get_info' do
    context 'given a channel tag' do
      let(:tag) { 'jblow'}

      it 'returns channel info' do
        VCR.use_cassette('channel_info') do
          expect(described_class.get_info tag).to be_a described_class
        end
      end

      it 'returns channel with recent pushes' do
        VCR.use_cassette('channel_info') do
          described_class.get_info(tag).recent_pushes.each do |push|
            expect(push).to be_a Pushbullet::Push
          end
        end
      end
    end
  end

  describe '::subscribe' do
    context 'given a channel tag' do
      let(:tag) { 'jblow' }

      it 'returns a channel' do
        VCR.use_cassette('channel_subscribe') do
          expect(described_class.subscribe tag).to be_a described_class
        end
      end
    end
  end

  describe '::unsubscribe' do
    context 'given a channel idn' do
      let(:idn) { 'ujx7XdJ9W8qsjAlOnVVSqy' }

      it 'unsubscribes a channel' do
        VCR.use_cassette('channel_unsubscribe') do
          expect(described_class.unsubscribe idn).to be_truthy
        end
      end
    end
  end
end

Version data entries

6 entries across 4 versions & 2 rubygems

Version Path
tdiary-5.0.5 vendor/bundle/gems/ruby-pushbullet-0.1.4/spec/pushbullet/channel_spec.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/ruby-pushbullet-0.1.4/spec/pushbullet/channel_spec.rb
tdiary-5.0.4 vendor/bundle/gems/ruby-pushbullet-0.1.4/spec/pushbullet/channel_spec.rb
tdiary-4.2.1 vendor/bundle/ruby/2.2.0/gems/ruby-pushbullet-0.1.4/spec/pushbullet/channel_spec.rb
tdiary-4.2.1 vendor/bundle/ruby/2.3.0/gems/ruby-pushbullet-0.1.4/spec/pushbullet/channel_spec.rb
ruby-pushbullet-0.1.4 spec/pushbullet/channel_spec.rb