From ddea35e23596e32255222a001538571e335055af Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 25 Aug 2013 08:22:20 +0000 Subject: tests: use unix_client in tests to kill some redundant code This should make porting to different Unix socket types easier, too. Much of these tests were written before I decided to implement unix_client originally. --- test/test_format_change.rb | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'test/test_format_change.rb') diff --git a/test/test_format_change.rb b/test/test_format_change.rb index ed0e7a2..b6edd7e 100644 --- a/test/test_format_change.rb +++ b/test/test_format_change.rb @@ -13,15 +13,12 @@ class TestFormatChange < Minitest::Unit::TestCase d = "#{dir}/dump.$CHANNELS.$RATE" f44100 = File.open("#{dir}/dump.2.44100", IO::RDWR|IO::CREAT) f88200 = File.open("#{dir}/dump.2.88200", IO::RDWR|IO::CREAT) - s.preq("sink ed dump active=true command='cat > #{d}'") - assert_equal "OK", s.readpartial(666) + s.req_ok("sink ed dump active=true command='cat > #{d}'") noise, len = tmp_noise - s.preq(%W(enq #{noise.path})) - assert_equal "OK", s.readpartial(666) + s.req_ok(%W(enq #{noise.path})) wait_files_not_empty(default_pid, f44100) - s.preq("format rate=88200") - assert_equal "OK", s.readpartial(666) + s.req_ok("format rate=88200") wait_files_not_empty(f88200) @@ -29,8 +26,7 @@ class TestFormatChange < Minitest::Unit::TestCase Timeout.timeout(len) do begin - s.preq("current") - cur = YAML.load(s.readpartial(6666)) + cur = YAML.load(s.req("current")) end while cur["sinks"] && sleep(0.01) end -- cgit v1.2.3-24-ge0c7