Sha256: dc2ac48382bd04f9d79474128226afa4aa10d260415bd50626eef61263a62fe2

Contents?: true

Size: 821 Bytes

Versions: 22

Compression:

Stored size: 821 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

module Bullet
  describe NotificationCollector do
    subject { NotificationCollector.new.tap { |collector| collector.add('value') } }

    context '#add' do
      it 'should add a value' do
        subject.add('value1')
        expect(subject.collection).to be_include('value1')
      end
    end

    context '#reset' do
      it 'should reset collector' do
        subject.reset
        expect(subject.collection).to be_empty
      end
    end

    context '#notifications_present?' do
      it 'should be true if collection is not empty' do
        expect(subject).to be_notifications_present
      end

      it 'should be false if collection is empty' do
        subject.reset
        expect(subject).not_to be_notifications_present
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
bullet-7.0.7 spec/bullet/notification_collector_spec.rb
bullet-7.0.6 spec/bullet/notification_collector_spec.rb
bullet-7.0.5 spec/bullet/notification_collector_spec.rb
bullet-7.0.4 spec/bullet/notification_collector_spec.rb
bullet-7.0.3 spec/bullet/notification_collector_spec.rb
bullet-7.0.2 spec/bullet/notification_collector_spec.rb
bullet-7.0.1 spec/bullet/notification_collector_spec.rb
bullet-7.0.0 spec/bullet/notification_collector_spec.rb
bullet-6.1.5 spec/bullet/notification_collector_spec.rb
bullet-6.1.4 spec/bullet/notification_collector_spec.rb
bullet-6.1.3 spec/bullet/notification_collector_spec.rb
bullet-6.1.2 spec/bullet/notification_collector_spec.rb
bullet-6.1.1 spec/bullet/notification_collector_spec.rb
bullet-6.1.0 spec/bullet/notification_collector_spec.rb
bullet-6.0.2 spec/bullet/notification_collector_spec.rb
bullet-6.0.1 spec/bullet/notification_collector_spec.rb
bullet-6.0.0 spec/bullet/notification_collector_spec.rb
bullet-5.9.0 spec/bullet/notification_collector_spec.rb
bullet-5.8.1 spec/bullet/notification_collector_spec.rb
bullet-5.8.0 spec/bullet/notification_collector_spec.rb