Sha256: 028716cf69e9fd3f3d1494fd93d6d95420bbe2e6d74a8dd40424fead392b8ece

Contents?: true

Size: 1.11 KB

Versions: 49

Compression:

Stored size: 1.11 KB

Contents

require 'spec_helper'

describe 'whenever' do
  before do
    mock_config { use_recipe :whenever}
  end

  describe 'whenever_identifier' do
    before do
      mock_config { set :application, 'foo' }
    end

    it 'defaults to application' do
      config.whenever_identifier.should == 'foo'
    end

    it 'default to application with stage when using multistage' do
      mock_config do
        use_recipe :multistage
        set :current_stage, 'bar'
      end
      config.whenever_identifier.should == 'foo_bar'
    end
  end

  describe 'whenever_cmd' do
    it 'has default value' do
      config.whenever_cmd.should == 'whenever'
    end

    it 'respects bundle recipe' do
      mock_config { use_recipe :bundle }
      config.whenever_cmd.should == 'bundle exec whenever'
    end
  end

  describe 'whenever:update_crontab' do
    it 'runs command' do
      mock_config do
        set :deploy_to, '/foo/bar'
        set :whenever_cmd, 'wc'
        set :whenever_identifier, 'wi'
      end
      cli_execute 'whenever:update_crontab'
      config.should have_run('cd /foo/bar && wc --update-crontab wi')
    end
  end
end

Version data entries

49 entries across 49 versions & 2 rubygems

Version Path
capistrano-deploy-management-0.1.47 spec/whenever_spec.rb
capistrano-deploy-management-0.1.46 spec/whenever_spec.rb
capistrano-deploy-management-0.1.45 spec/whenever_spec.rb
capistrano-deploy-management-0.1.44 spec/whenever_spec.rb
capistrano-deploy-management-0.1.43 spec/whenever_spec.rb
capistrano-deploy-management-0.1.42 spec/whenever_spec.rb
capistrano-deploy-management-0.1.41 spec/whenever_spec.rb
capistrano-deploy-management-0.1.40 spec/whenever_spec.rb
capistrano-deploy-management-0.1.39 spec/whenever_spec.rb
capistrano-deploy-management-0.1.38 spec/whenever_spec.rb
capistrano-deploy-management-0.1.37 spec/whenever_spec.rb
capistrano-deploy-management-0.1.36 spec/whenever_spec.rb
capistrano-deploy-management-0.1.35 spec/whenever_spec.rb
capistrano-deploy-management-0.1.34 spec/whenever_spec.rb
capistrano-deploy-management-0.1.33 spec/whenever_spec.rb
capistrano-deploy-management-0.1.32 spec/whenever_spec.rb
capistrano-deploy-management-0.1.31 spec/whenever_spec.rb
capistrano-deploy-management-0.1.30 spec/whenever_spec.rb
capistrano-deploy-management-0.1.29 spec/whenever_spec.rb
capistrano-deploy-management-0.1.28 spec/whenever_spec.rb