Sha256: cfbd8e370a4ccc2e3d796db36a7b20127c906af459cf0723d99db120f96acc3f

Contents?: true

Size: 1.13 KB

Versions: 2

Compression:

Stored size: 1.13 KB

Contents

require 'spec_helper'

module Wrapp
  describe CLI do
    let(:cli) { CLI.new }
    let(:app_path) { '/Applications/Chunky Bacon.app' }

    describe '.run' do
      it 'runs an instance with ARGV' do
        cli.should_receive(:run).with(ARGV)
        CLI.stub(:new).and_return(cli)
        CLI.run
      end
    end

    describe '#run' do
      let(:argv) { [app_path] }

      it 'wraps the app' do
        cli.should_receive(:wrapp).with(app_path, {})
        cli.run(argv)
      end

      %w(--include-parent-dir -i).each do |opt|
        context "with #{opt}" do
          let(:argv) { [app_path, opt] }

          it 'wraps the app including the parent directory' do
            cli.should_receive(:wrapp).
              with(app_path, :include_parent_dir => true)
            cli.run(argv)
          end
        end
      end
    end

    describe '#wrapp' do
      it 'creates the dmg via dmg builder' do
        opts = %(some options and arguments)
        dmg = double('dmg_builder')
        dmg.should_receive(:create)
        DMGBuilder.should_receive(:new).with(*opts).and_return(dmg)
        cli.wrapp(*opts)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
wrapp-0.2.1 spec/wrapp/cli_spec.rb
wrapp-0.2.0 spec/wrapp/cli_spec.rb