From aab6a6d14c592fdf0c7491b5430bcca1dd722e4a Mon Sep 17 00:00:00 2001 From: Eric Oestrich Date: Fri, 21 Oct 2011 10:45:52 -0400 Subject: [PATCH] respond to MKD --- lib/fake_ftp/server.rb | 5 +++++ spec/models/fake_ftp/server_spec.rb | 9 ++------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/fake_ftp/server.rb b/lib/fake_ftp/server.rb index c9ab3d8..6285d32 100644 --- a/lib/fake_ftp/server.rb +++ b/lib/fake_ftp/server.rb @@ -14,6 +14,7 @@ class Server cdup dele list + mkd nlst pass pasv @@ -297,6 +298,10 @@ def _rnto(name = nil) '250 OK!' end + def _mkd(directory) + "257 OK!" + end + def active? @mode == :active end diff --git a/spec/models/fake_ftp/server_spec.rb b/spec/models/fake_ftp/server_spec.rb index 6928682..2b87c2f 100644 --- a/spec/models/fake_ftp/server_spec.rb +++ b/spec/models/fake_ftp/server_spec.rb @@ -225,11 +225,6 @@ client.puts "CDUP" client.gets.should == "250 OK!\r\n" end - - it "does not respond to MKD" do - client.puts "MKD some_dir" - client.gets.should == "500 Unknown command\r\n" - end end context 'file commands' do @@ -394,9 +389,9 @@ @data_server = nil end - it "does not respond to MKD" do + it 'creates a directory on MKD' do client.puts "MKD some_dir" - client.gets.should == "500 Unknown command\r\n" + client.gets.should == "257 OK!\r\n" end it 'should save the directory after you CWD' do