Sha256: 612484c89a37aa9e8abf426e326a9781cdd2b44ca89ebfbb8ad172595c0686ba

Contents?: true

Size: 1.21 KB

Versions: 32

Compression:

Stored size: 1.21 KB

Contents

require 'spec_helper'
require 'puppet/module_tool/applications'
require 'puppet_spec/modules'

describe Puppet::ModuleTool::Applications::Builder do
  include PuppetSpec::Files

  let(:path)         { tmpdir("working_dir") }
  let(:module_name)  { 'myusername-mytarball' }
  let(:version)      { '0.0.1' }
  let(:release_name) { "#{module_name}-#{version}" }
  let(:tarball)      { File.join(path, 'pkg', release_name) + ".tar.gz" }
  let(:builder)      { Puppet::ModuleTool::Applications::Builder.new(path) }

  before :each do
    File.open(File.join(path, 'Modulefile'), 'w') do |f|
      f.write(<<EOM)
name    '#{module_name}'
version '#{version}'
source 'http://github.com/testing/#{module_name}'
author 'testing'
license 'Apache License Version 2.0'
summary 'Puppet testing module'
description 'This module can be used for basic testing'
project_page 'http://github.com/testing/#{module_name}'
EOM
    end
  end

  it "should attempt to create a module relative to the pkg directory" do
    tarrer = mock('tarrer')
    Puppet::ModuleTool::Tar.expects(:instance).with(module_name).returns(tarrer)
    Dir.expects(:chdir).with(File.join(path, 'pkg')).yields
    tarrer.expects(:pack).with(release_name, tarball)

    builder.run
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
puppet-3.5.1 spec/unit/module_tool/applications/builder_spec.rb
puppet-3.5.1-x86-mingw32 spec/unit/module_tool/applications/builder_spec.rb
puppet-3.5.1.rc1 spec/unit/module_tool/applications/builder_spec.rb
puppet-3.5.1.rc1-x86-mingw32 spec/unit/module_tool/applications/builder_spec.rb
puppet-3.5.0.rc3 spec/unit/module_tool/applications/builder_spec.rb
puppet-3.5.0.rc3-x86-mingw32 spec/unit/module_tool/applications/builder_spec.rb
puppet-3.5.0.rc2 spec/unit/module_tool/applications/builder_spec.rb
puppet-3.5.0.rc2-x86-mingw32 spec/unit/module_tool/applications/builder_spec.rb
puppet-3.5.0.rc1 spec/unit/module_tool/applications/builder_spec.rb
puppet-3.5.0.rc1-x86-mingw32 spec/unit/module_tool/applications/builder_spec.rb
puppet-3.4.3 spec/unit/module_tool/applications/builder_spec.rb
puppet-3.4.2 spec/unit/module_tool/applications/builder_spec.rb
puppet-3.4.1 spec/unit/module_tool/applications/builder_spec.rb
puppet-3.4.0 spec/unit/module_tool/applications/builder_spec.rb
puppet-3.4.0.rc2 spec/unit/module_tool/applications/builder_spec.rb
puppet-3.4.0.rc1 spec/unit/module_tool/applications/builder_spec.rb
puppet-3.3.2 spec/unit/module_tool/applications/builder_spec.rb
puppet-3.3.1 spec/unit/module_tool/applications/builder_spec.rb
puppet-3.3.1.rc3 spec/unit/module_tool/applications/builder_spec.rb
puppet-3.3.1.rc2 spec/unit/module_tool/applications/builder_spec.rb