Sha256: 78801208cbf29cda0b55037c377c3ba185b44bf3bf806a102db66e1bb61c406c

Contents?: true

Size: 690 Bytes

Versions: 40

Compression:

Stored size: 690 Bytes

Contents

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

40 entries across 40 versions & 1 rubygems

Version Path
nanoc-4.4.5 test/base/test_notification_center.rb
nanoc-4.4.4 test/base/test_notification_center.rb
nanoc-4.4.3 test/base/test_notification_center.rb
nanoc-4.4.2 test/base/test_notification_center.rb
nanoc-4.4.1 test/base/test_notification_center.rb
nanoc-4.4.0 test/base/test_notification_center.rb
nanoc-4.3.8 test/base/test_notification_center.rb
nanoc-4.3.7 test/base/test_notification_center.rb
nanoc-4.3.6 test/base/test_notification_center.rb
nanoc-4.3.5 test/base/test_notification_center.rb
nanoc-4.3.4 test/base/test_notification_center.rb
nanoc-4.3.3 test/base/test_notification_center.rb
nanoc-4.3.2 test/base/test_notification_center.rb
nanoc-4.3.1 test/base/test_notification_center.rb
nanoc-4.3.0 test/base/test_notification_center.rb
nanoc-4.2.4 test/base/test_notification_center.rb
nanoc-4.2.3 test/base/test_notification_center.rb
nanoc-4.2.2 test/base/test_notification_center.rb
nanoc-4.2.1 test/base/test_notification_center.rb
nanoc-4.2.0 test/base/test_notification_center.rb