Sha256: 43e847594c9c9073875381009a795585861a886f10d60de167486847da3025e0

Contents?: true

Size: 946 Bytes

Versions: 1

Compression:

Stored size: 946 Bytes

Contents

require 'test_helper'
require 'stringio'
require 'tmpdir'
require 'fileutils'

describe "puppetry" do
  let(:module_dir) { "test_module" }
  let(:out) { StringIO.new }
  let(:working_dir) { Dir.mktmpdir }
  let(:cli) { Puppetry::CLI.new }

  before do
    cli.output = out
  end

  after do
    FileUtils.remove_entry_secure working_dir
  end

  describe "version" do
    it "shows the application's version" do
      cli.version
      out.string.must_match(/#{Puppetry::VERSION}/)
    end
  end

  describe "new" do
    before do
      @old_pwd = FileUtils.pwd
      FileUtils.cd(working_dir)

      cli.new module_dir
    end

    after do
      FileUtils.cd @old_pwd
    end

    it "creates a new module starting from a scaffolded one" do
      module_dir.must_contain_a_puppet_module
      module_dir.must_be_a_git_repository
      module_dir.must_track_remote "skeleton"
      assert_bundler_is_initialized_in  module_dir
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
puppetry_toolbox-0.0.5 test/end_to_end/puppetry_test.rb