Sha256: 3416d0d4ba1bccc4489cd967d07bb724d104343b5bdc80ef00188ce6cdc485bb

Contents?: true

Size: 1.05 KB

Versions: 18

Compression:

Stored size: 1.05 KB

Contents

require File.join(File.dirname(__FILE__),'../../spec_helper')

describe IMW::CompressedFiles::Compressible do

  before do
    IMWTest::Random.file('foobar.txt')
    @resource = IMW::Resource.new('foobar.txt')
  end

  it "should extend a local resource " do
    @resource.is_compressible?.should be_true
    @resource.is_compressed?.should   be_false
  end

  it "can compress a resource in place" do
    compressed_file = @resource.compress!

    # only the compressed file should now exist
    compressed_file.exist?.should        be_true
    @resource.exist?.should              be_false
    
    compressed_file.is_compressed?.should   be_true
    compressed_file.is_compressible?.should be_false
  end

  it "can compress a resource without overwriting the original file" do
    compressed_file = @resource.compress

    # both files should now exist
    compressed_file.exist?.should        be_true
    @resource.exist?.should              be_true
    
    compressed_file.is_compressed?.should   be_true
    compressed_file.is_compressible?.should be_false
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
imw-0.2.18 spec/imw/compressed_files/compressible_spec.rb
imw-0.2.17 spec/imw/compressed_files/compressible_spec.rb
imw-0.2.16 spec/imw/compressed_files/compressible_spec.rb
imw-0.2.15 spec/imw/compressed_files/compressible_spec.rb
imw-0.2.14 spec/imw/compressed_files/compressible_spec.rb
imw-0.2.13 spec/imw/compressed_files/compressible_spec.rb
imw-0.2.12 spec/imw/compressed_files/compressible_spec.rb
imw-0.2.11 spec/imw/compressed_files/compressible_spec.rb
imw-0.2.10 spec/imw/compressed_files/compressible_spec.rb
imw-0.2.9 spec/imw/compressed_files/compressible_spec.rb
imw-0.2.8 spec/imw/compressed_files/compressible_spec.rb
imw-0.2.7 spec/imw/compressed_files/compressible_spec.rb
imw-0.2.6 spec/imw/compressed_files/compressible_spec.rb
imw-0.2.5 spec/imw/compressed_files/compressible_spec.rb
imw-0.2.4 spec/imw/compressed_files/compressible_spec.rb
imw-0.2.3 spec/imw/compressed_files/compressible_spec.rb
imw-0.2.2 spec/imw/compressed_files/compressible_spec.rb
imw-0.2.1 spec/imw/compressed_files/compressible_spec.rb