Sha256: 2acfe36b169c8a32387520bade463fd2f543abce3059b1c6312a51864ff9e8cf

Contents?: true

Size: 694 Bytes

Versions: 1

Compression:

Stored size: 694 Bytes

Contents

# frozen_string_literal: true

describe Nanoc::Int::NotificationCenter do
  it 'receives notification after subscribing' do
    ping_received = false
    Nanoc::Int::NotificationCenter.on :ping_received, :test do
      ping_received = true
    end

    Nanoc::Int::NotificationCenter.post :ping_received
    expect(ping_received).to be
  end

  it 'does not receive notification after unsubscribing' do
    ping_received = false
    Nanoc::Int::NotificationCenter.on :ping_received, :test do
      ping_received = true
    end

    Nanoc::Int::NotificationCenter.remove :ping_received, :test

    Nanoc::Int::NotificationCenter.post :ping_received
    expect(ping_received).not_to be
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nanoc-4.8.12 spec/nanoc/base/services/notification_center_spec.rb