Sha256: 78e17be394c3c6e2f021131cece2df84c06e80751e1581749512d217f46b556d

Contents?: true

Size: 886 Bytes

Versions: 14

Compression:

Stored size: 886 Bytes

Contents

require 'spec_helper'

describe Berkshelf::Lockfile do
  describe "without a lockfile in place already" do
    before do
      @old_dir = Dir.pwd
      Dir.chdir fixtures_path.join("lockfile_spec", "without_lock")
    end

    it "should be able to write a Berksfile.lock from a list of cookbooks" do
      resolver = Berkshelf::Resolver.new(Berkshelf.downloader, Berkshelf::CookbookSource.new('nginx', '= 0.101.0'))
      resolver.resolve

      Berkshelf::Lockfile.new(resolver.sources).write

      File.read('Berksfile.lock').split(/\r?\n/).sort.should == [
        "cookbook 'bluepill', :locked_version => '1.0.4'",
        "cookbook 'build-essential', :locked_version => '1.0.2'", 
        "cookbook 'nginx', :locked_version => '0.101.0'", 
        "cookbook 'ohai', :locked_version => '1.0.2'", 
        "cookbook 'runit', :locked_version => '0.15.0'"
      ] 
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
berkshelf-0.4.0.rc3 spec/unit/berkshelf/lockfile_spec.rb
berkshelf-0.4.0.rc2 spec/unit/berkshelf/lockfile_spec.rb
berkshelf-0.4.0.rc1 spec/unit/berkshelf/lockfile_spec.rb
berkshelf-0.3.7 spec/unit/berkshelf/lockfile_spec.rb
berkshelf-0.3.3 spec/unit/berkshelf/lockfile_spec.rb
berkshelf-0.3.2 spec/unit/berkshelf/lockfile_spec.rb
berkshelf-0.3.1 spec/unit/berkshelf/lockfile_spec.rb
berkshelf-0.3.0 spec/unit/berkshelf/lockfile_spec.rb
berkshelf-0.2.0 spec/unit/berkshelf/lockfile_spec.rb
berkshelf-0.1.5 spec/unit/berkshelf/lockfile_spec.rb
berkshelf-0.1.4 spec/unit/berkshelf/lockfile_spec.rb
berkshelf-0.1.3 spec/unit/berkshelf/lockfile_spec.rb
berkshelf-0.1.2 spec/unit/berkshelf/lockfile_spec.rb
berkshelf-0.1.1 spec/unit/berkshelf/lockfile_spec.rb