Sha256: 6dd4bba084cd46c6a89ab48e507638416f92b5d68dbdf856cd3af54eacdeb6ba

Contents?: true

Size: 708 Bytes

Versions: 22

Compression:

Stored size: 708 Bytes

Contents

require 'helper'

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

22 entries across 22 versions & 1 rubygems

Version Path
nanoc-4.7.9 test/base/test_notification_center.rb
nanoc-4.7.8 test/base/test_notification_center.rb
nanoc-4.7.7 test/base/test_notification_center.rb
nanoc-4.7.6 test/base/test_notification_center.rb
nanoc-4.7.5 test/base/test_notification_center.rb
nanoc-4.7.4 test/base/test_notification_center.rb
nanoc-4.7.3 test/base/test_notification_center.rb
nanoc-4.7.2 test/base/test_notification_center.rb
nanoc-4.7.1 test/base/test_notification_center.rb
nanoc-4.7.0 test/base/test_notification_center.rb
nanoc-4.6.4 test/base/test_notification_center.rb
nanoc-4.6.3 test/base/test_notification_center.rb
nanoc-4.6.2 test/base/test_notification_center.rb
nanoc-4.6.1 test/base/test_notification_center.rb
nanoc-4.6.0 test/base/test_notification_center.rb
nanoc-4.5.4 test/base/test_notification_center.rb
nanoc-4.5.3 test/base/test_notification_center.rb
nanoc-4.5.2 test/base/test_notification_center.rb
nanoc-4.5.1 test/base/test_notification_center.rb
nanoc-4.5.0 test/base/test_notification_center.rb