Sha256: f0c4fb1ec2cc0d62e630a2d8bdf996574cbfba7eb262e8b9dcf15b431cb27e98

Contents?: true

Size: 1.22 KB

Versions: 4

Compression:

Stored size: 1.22 KB

Contents

require 'spec_helper'
require 'capistrano'

describe 'Capistrano has downloaded' do
  include Capistrano::Spec::Matchers

  before do
    @configuration = Capistrano::Configuration.new
    @configuration.extend Capistrano::Spec::ConfigurationExtension
    @configuration.load do
      def download_from_to
        download 'source.file', 'target.file'
      end

      def download_to
        download 'temp.XC3PO.file', 'target.file' # E.g. downloading generated tar
      end

      def download_from
        download 'source.file', 'temp.XC3PO.file' # E.g. downloading to temp file
      end
    end
  end

  subject(:configuration) { @configuration }

  it 'some file' do
    configuration.download 'source.file', 'target.file'

    expect(configuration).to have_downloaded
  end

  it 'a specific file from a specific location' do
    configuration.download_from_to

    expect(configuration).to have_downloaded('target.file').from('source.file')
  end

  it 'a specific file to some location' do
    configuration.download_from

    expect(configuration).to have_downloaded.from('source.file')
  end

  it 'some file to a specific location' do
    configuration.download_to

    expect(configuration).to have_downloaded('target.file')
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
capistrano-spec-0.6.3 spec/downloaded_spec.rb
capistrano-spec-0.6.2 spec/downloaded_spec.rb
capistrano-spec-0.6.1 spec/downloaded_spec.rb
capistrano-spec-0.6.0 spec/downloaded_spec.rb