Sha256: 49c974827a256955cd0a4e833cc0262d8c941a313d24b86321514102e80f2b87

Contents?: true

Size: 1.81 KB

Versions: 23

Compression:

Stored size: 1.81 KB

Contents

require 'spec_helper'

module Capistrano
  module DSL

    class DummyPaths
      include Paths
    end

    describe Paths do
      let(:paths) { DummyPaths.new }
      let(:parent) { Pathname.new('/var/shared') }

      let(:linked_dirs) { %w{log public/system} }
      let(:linked_files) { %w{config/database.yml log/my.log} }


      describe '#linked_dirs' do
        subject { paths.linked_dirs(parent) }

        before do
          paths.expects(:fetch).with(:linked_dirs).returns(linked_dirs)
        end

        it 'returns the full pathnames' do
          expect(subject).to eq [Pathname.new('/var/shared/log'), Pathname.new('/var/shared/public/system')]
        end
      end


      describe '#linked_files' do
        subject { paths.linked_files(parent) }

        before do
          paths.expects(:fetch).with(:linked_files).returns(linked_files)
        end

        it 'returns the full pathnames' do
          expect(subject).to eq [Pathname.new('/var/shared/config/database.yml'), Pathname.new('/var/shared/log/my.log')]
        end
      end

      describe '#linked_file_dirs' do
        subject { paths.linked_file_dirs(parent) }

        before do
          paths.expects(:fetch).with(:linked_files).returns(linked_files)
        end

        it 'returns the full paths names of the parent dirs' do
          expect(subject).to eq [Pathname.new('/var/shared/config'), Pathname.new('/var/shared/log')]
        end
      end

      describe '#linked_dir_parents' do
        subject { paths.linked_dir_parents(parent) }

        before do
          paths.expects(:fetch).with(:linked_dirs).returns(linked_dirs)
        end

        it 'returns the full paths names of the parent dirs' do
          expect(subject).to eq [Pathname.new('/var/shared'), Pathname.new('/var/shared/public')]
        end
      end

    end
  end
end

Version data entries

23 entries across 21 versions & 2 rubygems

Version Path
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/capistrano-3.2.1/spec/lib/capistrano/dsl/paths_spec.rb
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/capistrano-3.2.1/spec/lib/capistrano/dsl/paths_spec.rb
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/capistrano-3.2.1/spec/lib/capistrano/dsl/paths_spec.rb
capistrano-3.3.5 spec/lib/capistrano/dsl/paths_spec.rb
capistrano-3.3.4 spec/lib/capistrano/dsl/paths_spec.rb
capistrano-3.3.3 spec/lib/capistrano/dsl/paths_spec.rb
capistrano-3.2.1 spec/lib/capistrano/dsl/paths_spec.rb
capistrano-3.2.0 spec/lib/capistrano/dsl/paths_spec.rb
capistrano-3.1.0 spec/lib/capistrano/dsl/paths_spec.rb
capistrano-3.0.1 spec/lib/capistrano/dsl/paths_spec.rb
capistrano-3.0.0 spec/lib/capistrano/dsl/paths_spec.rb
capistrano-3.0.0.pre14 spec/lib/capistrano/dsl/paths_spec.rb
capistrano-3.0.0.pre13 spec/lib/capistrano/dsl/paths_spec.rb
capistrano-3.0.0.pre12 spec/lib/capistrano/dsl/paths_spec.rb
capistrano-3.0.0.pre11 spec/lib/capistrano/dsl/paths_spec.rb
capistrano-3.0.0.pre10 spec/lib/capistrano/dsl/paths_spec.rb
capistrano-3.0.0.pre7 spec/lib/capistrano/dsl/paths_spec.rb
capistrano-3.0.0.pre6 spec/lib/capistrano/dsl/paths_spec.rb
capistrano-3.0.0.pre5 spec/lib/capistrano/dsl/paths_spec.rb
capistrano-3.0.0.pre4 spec/lib/capistrano/dsl/paths_spec.rb