Sha256: b7abd006ca1a75625f378dd5338a5c13391661eff118883d04cedf0c96c20071

Contents?: true

Size: 1.17 KB

Versions: 33

Compression:

Stored size: 1.17 KB

Contents

$LOAD_PATH.unshift File.dirname(__FILE__) + '/../lib'

require 'minitest/autorun'
require_relative 'test_helper'
require 'fileutils'

class ChefPackageTest < MiniTest::Unit::TestCase
  include FileUtils

  def setup
    Opsk::Root.start ['generate_chef', 'foo', 'bar']
    Dir.mkdir('foo-sandbox/cookbooks')
    FileUtils.touch('foo-sandbox/cookbooks/1')
    FileUtils.touch('foo-sandbox/Gemfile.lock')
  end

  def teardown 
    rm_rf 'foo-sandbox'
  end

  def with_cwd(dir)
    Dir.chdir dir do
	yield  
    end
  end

  def test_build
    with_cwd 'foo-sandbox' do
	Opsk::Root.start ['package']
    end
    assert File.exists?('foo-sandbox/pkg/foo-sandbox-0.0.1/Cheffile')
    assert File.exists?('foo-sandbox/pkg/foo-sandbox-0.0.1/roles/foo.rb')
    assert File.exists?('foo-sandbox/pkg/foo-sandbox-0.0.1/boot.sh')
    assert Dir.exists?('foo-sandbox/pkg/foo-sandbox-0.0.1/cookbooks')
    assert Dir.exists?('foo-sandbox/pkg/foo-sandbox-0.0.1/environments')
    assert File.exists?('foo-sandbox/pkg/foo-sandbox-0.0.1/dna.json')
    assert File.exists?('foo-sandbox/pkg/foo-sandbox-0.0.1/environments/dev.rb')
    assert File.exists?('foo-sandbox/pkg/foo-sandbox-0.0.1.tar.gz')
  end

end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
opskeleton-0.9.8 test/chef_package_test.rb
opskeleton-0.9.7 test/chef_package_test.rb
opskeleton-0.9.6 test/chef_package_test.rb
opskeleton-0.9.5 test/chef_package_test.rb
opskeleton-0.9.4 test/chef_package_test.rb
opskeleton-0.9.3 test/chef_package_test.rb
opskeleton-0.9.2 test/chef_package_test.rb
opskeleton-0.9.1 test/chef_package_test.rb
opskeleton-0.9.0 test/chef_package_test.rb
opskeleton-0.8.12 test/chef_package_test.rb
opskeleton-0.8.11 test/chef_package_test.rb
opskeleton-0.8.10 test/chef_package_test.rb
opskeleton-0.8.9 test/chef_package_test.rb
opskeleton-0.8.8 test/chef_package_test.rb
opskeleton-0.8.7 test/chef_package_test.rb
opskeleton-0.8.6 test/chef_package_test.rb
opskeleton-0.8.5 test/chef_package_test.rb
opskeleton-0.8.4 test/chef_package_test.rb
opskeleton-0.8.3 test/chef_package_test.rb
opskeleton-0.8.2 test/chef_package_test.rb