Sha256: 736e330410e17ddbcfcc42ae695922cebe47cf5509d570b4a134f47a5c182763

Contents?: true

Size: 1.62 KB

Versions: 4

Compression:

Stored size: 1.62 KB

Contents

require File.expand_path('../spec_helper', __FILE__)

module XcodeInstall
  describe Command::Install do
    before do
      Installer.any_instance.stubs(:exists).returns(true)
      Installer.any_instance.stubs(:installed).returns([])
      fixture = Pathname.new('spec/fixtures/xcode_63.json').read
      xcode = Xcode.new(JSON.parse(fixture))
      Installer.any_instance.stubs(:seedlist).returns([xcode])
    end

    it 'downloads and installs' do
      Installer.any_instance.expects(:download).with('6.3', true).returns('/some/path')
      Installer.any_instance.expects(:install_dmg).with('/some/path', '-6.3', true, true, true)
      Command::Install.run(['6.3'])
    end

    it 'downloads and installs and does not switch if --no-switch given' do
      Installer.any_instance.expects(:download).with('6.3', true).returns('/some/path')
      Installer.any_instance.expects(:install_dmg).with('/some/path', '-6.3', false, true, true)
      Command::Install.run(['6.3', '--no-switch'])
    end

    it 'downloads without progress if switch --no-progress is given' do
      Installer.any_instance.expects(:download).with('6.3', false).returns('/some/path')
      Installer.any_instance.expects(:install_dmg).with('/some/path', '-6.3', true, true, true)
      Command::Install.run(['6.3', '--no-progress'])
    end

    it 'does not install components if switch --no-components is given' do
      Installer.any_instance.expects(:download).with('6.3', true).returns('/some/path')
      Installer.any_instance.expects(:install_dmg).with('/some/path', '-6.3', true, true, false)
      Command::Install.run(['6.3', '--no-components'])
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
xcode-install-0.9.5 spec/install_spec.rb
xcode-install-0.9.4 spec/install_spec.rb
xcode-install-0.9.3 spec/install_spec.rb
xcode-install-0.9.2 spec/install_spec.rb