Sha256: 1fbd5d2f5e01ba664907bc0aa330fd1179f5be7d237c07c488ef312f1f86efd2

Contents?: true

Size: 911 Bytes

Versions: 10

Compression:

Stored size: 911 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

10 entries across 10 versions & 1 rubygems

Version Path
ftpd-0.3.2 features/step_definitions/client_and_server_files.rb
ftpd-0.3.1 features/step_definitions/client_and_server_files.rb
ftpd-0.2.2 features/step_definitions/client_and_server_files.rb
ftpd-0.2.1 features/step_definitions/client_and_server_files.rb
ftpd-0.2.0 features/step_definitions/client_and_server_files.rb
ftpd-0.1.1 features/step_definitions/client_and_server_files.rb
ftpd-0.1.0 features/step_definitions/client_and_server_files.rb
ftpd-0.0.1.pre features/step_definitions/client_and_server_files.rb
ftpd-0.0.0.pre2 features/step_definitions/client_and_server_files.rb
ftpd-0.0.0.pre1 features/step_definitions/client_and_server_files.rb