Sha256: 469761df654cbd26ca7a180b0baa100cf44c8be79d39080f148d89f31abd1e1b

Contents?: true

Size: 565 Bytes

Versions: 2

Compression:

Stored size: 565 Bytes

Contents

require "./lib/notifilter"

describe Notifilter do
  around do |spec|
    @server = UDPSocket.new
    @server.bind("127.0.0.1", "8001")
    spec.run
    @server.close
  end

  it "sends correct message" do
    data = { "id" => 1, "name" => "John Doe", "active" => false }
    notifilter = Notifilter.new("test_app", "127.0.0.1", "8001")
    notifilter.notify("user.created", data)

    received = @server.recv(1000)
    result = { "application" => "test_app", "identifier" => "user.created", "data" => data }
    expect(JSON.parse(received)).to eq result
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
notifilter-1.0.0 spec/notifilter_spec.rb
notifilter-0.0.2 spec/notifilter_spec.rb