about summary refs log tree commit homepage
path: root/test/test_player_integration.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_player_integration.rb')
-rw-r--r--test/test_player_integration.rb21
1 files changed, 21 insertions, 0 deletions
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