From 7cdd995d1cf34b04f7353bc22382cb6e68098d99 Mon Sep 17 00:00:00 2001 From: Cale Hoopes Date: Sun, 17 Jul 2016 15:53:12 -0700 Subject: [PATCH] Fixing some code and finally have Travis building Signed-off-by: Cale Hoopes --- platforms/nats/nats_adaptor.go | 7 +------ platforms/nats/nats_adaptor_test.go | 5 +++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/platforms/nats/nats_adaptor.go b/platforms/nats/nats_adaptor.go index 5ab39a146..7c48fe1f2 100644 --- a/platforms/nats/nats_adaptor.go +++ b/platforms/nats/nats_adaptor.go @@ -88,12 +88,7 @@ func (a *NatsAdaptor) On(event string, f func(s []byte)) bool { return false } a.client.Subscribe(event, func(msg *nats.Msg) { - incoming := msg.Data - if string(incoming) == "PING" { - a.Publish(event, []byte("PONG")) - } else { - f(msg.Data) - } + f(msg.Data) }) return true } diff --git a/platforms/nats/nats_adaptor_test.go b/platforms/nats/nats_adaptor_test.go index e7ea30db5..4beace166 100644 --- a/platforms/nats/nats_adaptor_test.go +++ b/platforms/nats/nats_adaptor_test.go @@ -10,6 +10,11 @@ import ( var _ gobot.Adaptor = (*NatsAdaptor)(nil) +func TestNatsAdaptorReturnsName(t *testing.T) { + a := NewNatsAdaptor("Nats", "localhost:4222", 9999) + gobottest.Assert(t, a.Name(), "Nats") +} + func TestNatsAdaptorPublishWhenConnected(t *testing.T) { a := NewNatsAdaptor("Nats", "localhost:4222", 9999) a.Connect()