Sha256: 4f8cc9f5fc0c2fe7afedb9bb4aae23729e30a244fd2115a8d12d11a5c167de7f

Contents?: true

Size: 907 Bytes

Versions: 13

Compression:

Stored size: 907 Bytes

Contents

def unix_line_endings(exactly, s)
  return s if exactly
  s.gsub(/\r\n/, "\n")
end

Then /^the remote file "(.*?)" should( exactly)? match the local file$/ do
|remote_path, exactly|
  local_path = File.basename(remote_path)
  remote_contents = server.file_contents(remote_path)
  local_contents = client.file_contents(local_path)
  remote_contents = unix_line_endings(exactly, remote_contents)
  local_contents = unix_line_endings(exactly, local_contents)
  remote_contents.should == local_contents
end

Then /^the local file "(.*?)" should( exactly)? match the remote file$/ do
|local_path, exactly|
  remote_path = local_path
  remote_contents = server.file_contents(remote_path)
  local_contents = client.file_contents(local_path)
  remote_contents = unix_line_endings(exactly, remote_contents)
  local_contents = unix_line_endings(exactly, local_contents)
  local_contents.should == remote_contents
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
ftpd-0.17.0 features/step_definitions/client_and_server_files.rb
ftpd-0.16.0 features/step_definitions/client_and_server_files.rb
ftpd-0.15.0 features/step_definitions/client_and_server_files.rb
ftpd-0.14.0 features/step_definitions/client_and_server_files.rb
ftpd-0.13.0 features/step_definitions/client_and_server_files.rb
ftpd-0.12.0 features/step_definitions/client_and_server_files.rb
ftpd-0.11.0 features/step_definitions/client_and_server_files.rb
ftpd-0.10.0 features/step_definitions/client_and_server_files.rb
ftpd-0.9.0 features/step_definitions/client_and_server_files.rb
ftpd-0.7.1 features/step_definitions/client_and_server_files.rb
ftpd-0.8.0 features/step_definitions/client_and_server_files.rb
ftpd-0.7.0 features/step_definitions/client_and_server_files.rb
ftpd-0.6.0 features/step_definitions/client_and_server_files.rb