Sha256: 450c78cd496bc70c2c5df7b6627775777a3d29be47b6fcb1ba7335fee85adad8

Contents?: true

Size: 354 Bytes

Versions: 2

Compression:

Stored size: 354 Bytes

Contents

require 'test_helper'

describe "Source" do
  describe "#emit" do
    it "notifies observers" do
      pushed = nil
      source = Object.new.extend(Frappuccino::Source)
      source.add_observer(Observer.new { |value| pushed = value })
      source.emit("EVENT!")

      assert_equal "EVENT!", pushed, "#emit did not notify observers"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
frappuccino-0.3.0 test/source_test.rb
frappuccino-0.2.0 test/source_test.rb