Sha256: 7196f2d55e83b3cc7ad8eb48cd6ac846b90078e5dabe3b9742f601b57c41d358

Contents?: true

Size: 946 Bytes

Versions: 2

Compression:

Stored size: 946 Bytes

Contents

# frozen_string_literal: true

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)
  expect(remote_contents).to eq 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)
  expect(local_contents).to eq remote_contents
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ftpd-2.0.1 features/step_definitions/client_and_server_files.rb
ftpd-2.0.0 features/step_definitions/client_and_server_files.rb