diff --git a/platforms/audio/audio_adaptor_test.go b/platforms/audio/audio_adaptor_test.go index c9ef6c9f..d1af90f2 100644 --- a/platforms/audio/audio_adaptor_test.go +++ b/platforms/audio/audio_adaptor_test.go @@ -3,6 +3,7 @@ package audio import ( "os/exec" + "strings" "testing" "gobot.io/x/gobot" @@ -18,6 +19,13 @@ func TestAudioAdaptor(t *testing.T) { gobottest.Assert(t, a.Finalize(), nil) } +func TestAudioAdaptorName(t *testing.T) { + a := NewAdaptor() + gobottest.Assert(t, strings.HasPrefix(a.Name(), "Audio"), true) + a.SetName("NewName") + gobottest.Assert(t, a.Name(), "NewName") +} + func TestAudioAdaptorCommandsWav(t *testing.T) { cmd, _ := CommandName("whatever.wav") gobottest.Assert(t, cmd, "aplay") diff --git a/platforms/audio/audio_driver_test.go b/platforms/audio/audio_driver_test.go index 84eafae3..d7e7a0c7 100644 --- a/platforms/audio/audio_driver_test.go +++ b/platforms/audio/audio_driver_test.go @@ -4,6 +4,7 @@ package audio import ( "os/exec" + "strings" "testing" "gobot.io/x/gobot" @@ -24,6 +25,13 @@ func TestAudioDriver(t *testing.T) { gobottest.Assert(t, d.Halt(), nil) } +func TestAudioDriverName(t *testing.T) { + d := NewDriver(NewAdaptor(), "") + gobottest.Assert(t, strings.HasPrefix(d.Name(), "Audio"), true) + d.SetName("NewName") + gobottest.Assert(t, d.Name(), "NewName") +} + func TestAudioDriverSoundWithNoFilename(t *testing.T) { d := NewDriver(NewAdaptor(), "")