Sha256: 7f02d92432bd926d348db0ce5b8625c04596905b61a38616a18f0433a6fb476b

Contents?: true

Size: 774 Bytes

Versions: 18

Compression:

Stored size: 774 Bytes

Contents

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")
        subject.collection.should be_include("value1")
      end
    end

    context "#reset" do
      it "should reset collector" do
        subject.reset
        subject.collection.should be_empty
      end
    end

    context "#notifications_present?" do
      it "should be true if collection is not empty" do
        subject.should be_notifications_present
      end

      it "should be false if collection is empty" do
        subject.reset
        subject.should_not be_notifications_present
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
bullet-4.7.1 spec/bullet/notification_collector_spec.rb
bullet-4.7.0 spec/bullet/notification_collector_spec.rb
bullet-4.6.0 spec/bullet/notification_collector_spec.rb
bullet-4.5.0 spec/bullet/notification_collector_spec.rb
bullet-4.4.0 spec/bullet/notification_collector_spec.rb
bullet-4.3.1 spec/bullet/notification_collector_spec.rb
bullet-4.3.0 spec/bullet/notification_collector_spec.rb
bullet-4.2.0 spec/bullet/notification_collector_spec.rb
bullet-4.1.6 spec/bullet/notification_collector_spec.rb
bullet-4.1.5 spec/bullet/notification_collector_spec.rb
bullet-4.1.4 spec/bullet/notification_collector_spec.rb
bullet-4.1.3 spec/bullet/notification_collector_spec.rb
bullet-4.1.2 spec/bullet/notification_collector_spec.rb
bullet-4.1.1 spec/bullet/notification_collector_spec.rb
bullet-4.1.0 spec/bullet/notification_collector_spec.rb
bullet-4.0.0 spec/bullet/notification_collector_spec.rb
bullet-2.3.1 spec/bullet/notification_collector_spec.rb
bullet-2.3.0 spec/bullet/notification_collector_spec.rb