Sha256: 0de533c25b2998c370b7e263290a7dd19c7d9d95e805474d614542f0a403d0b6

Contents?: true

Size: 1.4 KB

Versions: 2

Compression:

Stored size: 1.4 KB

Contents

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

def fixture_project(named)
  ROOT + "spec/fixtures/Project/#{named}"
end

def temporary_directory
  ROOT + 'tmp'
end

def deintegrate(directory)
  Dir.chdir(directory) do
    command = Pod::Command.parse(['deintegrate'])
    command.config.sandbox.stubs(:root).returns(directory + 'Pods')
    command.validate!
    command.run
  end
end

def deintegrate_project(named)
  path = fixture_project(named)
  `rsync -r #{path}/ #{temporary_directory}`

  deintegrate(temporary_directory)

  (temporary_directory + 'TestProject.xcworkspace').rmtree
  (temporary_directory + 'Podfile').delete
  (temporary_directory + 'Podfile.lock').delete

  output = `diff -r #{fixture_project('None')} #{temporary_directory}`
  puts(output) unless $?.success?

  $?.success?.should == true
end

module Pod
  describe Command::Deintegrate do
    describe 'CLAide' do
      it 'registers it self' do
        Command.parse(['deintegrate']).should.be.instance_of Command::Deintegrate
      end
    end

    before do
      temporary_directory.rmtree if temporary_directory.exist?
      temporary_directory.mkdir
    end

    after do
      temporary_directory.rmtree
    end

    it 'deintegrates a static library integrated project' do
      deintegrate_project('StaticLibraries')
    end

    it 'deintegrates a framework integrated project' do
      deintegrate_project('Frameworks')
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cocoapods-deintegrate-0.2.1 spec/command/deintegrate_spec.rb
cocoapods-deintegrate-0.2.0 spec/command/deintegrate_spec.rb