From 09178fca7320ed4919b7c5e845598f9ad998d6d3 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 24 Aug 2013 20:58:25 +0000 Subject: player: cd/pwd handlers for manipulating working directory Some effects may be easier to save/store with relative directory paths, so allow changing this at runtime. --- test/test_player_integration.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'test/test_player_integration.rb') diff --git a/test/test_player_integration.rb b/test/test_player_integration.rb index f7b1306..4ce0752 100644 --- a/test/test_player_integration.rb +++ b/test/test_player_integration.rb @@ -196,4 +196,25 @@ class TestPlayerIntegration < Minitest::Unit::TestCase assert(system("cmp", dump.path, expect.path), "files don't match #{dump.path} != #{expect.path}") end + + def test_cd_pwd + s = client_socket + pwd = Dir.pwd + + s.preq("pwd") + assert_equal pwd, s.readpartial(6666) + + s.preq("cd /") + assert_equal "OK", s.readpartial(6) + + s.preq("pwd") + assert_equal "/", s.readpartial(6) + + s.preq("cd /this-better-be-totally-non-existent-on-any-system-#{rand}") + err = s.readpartial(666) + assert_match(%r{\AERR }, err, err) + + s.preq("pwd") + assert_equal "/", s.readpartial(6) + end end -- cgit v1.2.3-24-ge0c7