Sha256: a0c4becd5ce8d4f42374d9decc1c5d493d4ab96e421d44ff67846b232327d37b

Contents?: true

Size: 1.47 KB

Versions: 8

Compression:

Stored size: 1.47 KB

Contents

require 'rsync/change'

describe Rsync::Change do
  it "should handle filename" do
    Rsync::Change.new("            filename").filename.should eql("filename")
  end

  it "should handle message type" do
    Rsync::Change.new("*deleting  ").summary.should eql("deleting")
  end

  it "should handle update types" do
    Rsync::Change.new("<          ").update_type.should eql(:sent)
    Rsync::Change.new(">          ").update_type.should eql(:recv)
    Rsync::Change.new("c          ").update_type.should eql(:change)
    Rsync::Change.new("h          ").update_type.should eql(:hard_link)
    Rsync::Change.new(".          ").update_type.should eql(:no_update)
    Rsync::Change.new("*          ").update_type.should eql(:message)
  end

  it "should handle file types" do
    Rsync::Change.new(" f         ").file_type.should eql(:file)
    Rsync::Change.new(" d         ").file_type.should eql(:directory)
    Rsync::Change.new(" L         ").file_type.should eql(:symlink)
    Rsync::Change.new(" D         ").file_type.should eql(:device)
    Rsync::Change.new(" S         ").file_type.should eql(:special)
  end

  it "should handle checksum info" do
    Rsync::Change.new("  c        ").checksum.should eql(:changed)
    Rsync::Change.new("  .        ").checksum.should eql(:no_change)
    Rsync::Change.new("           ").checksum.should eql(:identical)
    Rsync::Change.new("  +        ").checksum.should eql(:new)
    Rsync::Change.new("  ?        ").checksum.should eql(:unknown)
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rsync-1.0.9 spec/rsync/change_spec.rb
rsync-1.0.8 spec/rsync/change_spec.rb
rsync-1.0.7 spec/rsync/change_spec.rb
rsync-0.0.6 spec/rsync/change_spec.rb
rsync-0.0.5 spec/rsync/change_spec.rb
rsync-0.0.4 spec/rsync/change_spec.rb
rsync-0.0.3 spec/rsync/change_spec.rb
rsync-0.0.2 spec/rsync/change_spec.rb