Sha256: 00717c76abac0721ec55cc14a9f0e254d0da42223fbaab593e7cdc828fd5a84a

Contents?: true

Size: 709 Bytes

Versions: 4

Compression:

Stored size: 709 Bytes

Contents

# encoding: utf-8

class Nanoc::Int::NotificationCenterTest < Nanoc::TestCase
  def test_post
    # Set up notification
    Nanoc::Int::NotificationCenter.on :ping_received, :test do
      @ping_received = true
    end

    # Post
    @ping_received = false
    Nanoc::Int::NotificationCenter.post :ping_received
    assert(@ping_received)
  end

  def test_remove
    # Set up notification
    Nanoc::Int::NotificationCenter.on :ping_received, :test do
      @ping_received = true
    end

    # Remove observer
    Nanoc::Int::NotificationCenter.remove :ping_received, :test

    # Post
    @ping_received = false
    Nanoc::Int::NotificationCenter.post :ping_received
    assert(!@ping_received)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
nanoc-4.0.0b2 test/base/test_notification_center.rb
nanoc-4.0.0b1 test/base/test_notification_center.rb
nanoc-4.0.0a2 test/base/test_notification_center.rb
nanoc-4.0.0a1 test/base/test_notification_center.rb