Sha256: d9895f2c4b59dae470bfda14da5c4e267af011b34ec265bd0e38afb2eeb3f5fb

Contents?: true

Size: 1.54 KB

Versions: 5

Compression:

Stored size: 1.54 KB

Contents

# encoding: UTF-8

require 'spec_helper'

describe Gjp::Archiver do
  before(:each) do
    @project_path = File.join("spec", "data", "test-project")
    Dir.mkdir(@project_path)

    Gjp::Project.init(@project_path)
    @project = Gjp::Project.new(@project_path)
  end

  after(:each) do
    FileUtils.rm_rf(@project_path)
  end

  let(:archiver) { Gjp::Archiver.new(@project) }

  describe "#archive" do
    it "archives a list of files" do
      @project.from_directory do
        File.open("test", "w") { |io| io.puts "test content" }
        File.open("test_list", "w") { |io| io.puts "test" }

        archiver.archive "test_list", "test.tar.xz"
        `tar -Jtf test.tar.xz`.split.should include("test")
      end
    end
  end

  describe "#archive_kit" do
    it "archives a kit package files" do
      @project.from_directory do
        File.open(File.join("kit","kit_test"), "w") { |io| io.puts "test content" }
      end
      @project.finish

      archiver.archive_kit
      @project.from_directory do
        `tar -Jtf archives/test-project-kit.tar.xz`.split.should include("kit_test")
      end
    end
  end

  describe "#archive_package" do
    it "archives a package files" do
      @project.from_directory do
        Dir.mkdir(File.join("src", "a:b:c"))
        File.open(File.join("src", "a:b:c", "src_test"), "w") { |io| io.puts "test content" }
      end
      @project.finish

      archiver.archive_package "a:b:c"
      @project.from_directory do
        `tar -Jtf archives/a:b:c.tar.xz`.split.should include("src_test")
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
gjp-0.17.1 spec/lib/archiver_spec.rb
gjp-0.17.0 spec/lib/archiver_spec.rb
gjp-0.16.1 spec/lib/archiver_spec.rb
gjp-0.16.0 spec/lib/archiver_spec.rb
gjp-0.15.7 spec/lib/archiver_spec.rb