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.25 spec/whenever_spec.rb
capistrano-deploy-management-0.1.24 spec/whenever_spec.rb
capistrano-deploy-management-0.1.23 spec/whenever_spec.rb
capistrano-deploy-management-0.1.22 spec/whenever_spec.rb
capistrano-deploy-management-0.1.21 spec/whenever_spec.rb
capistrano-deploy-management-0.1.20 spec/whenever_spec.rb
capistrano-deploy-management-0.1.19 spec/whenever_spec.rb
capistrano-deploy-management-0.1.18 spec/whenever_spec.rb
capistrano-deploy-management-0.1.17 spec/whenever_spec.rb
capistrano-deploy-management-0.1.16 spec/whenever_spec.rb
capistrano-deploy-management-0.1.15 spec/whenever_spec.rb
capistrano-deploy-management-0.1.14 spec/whenever_spec.rb
capistrano-deploy-management-0.1.13 spec/whenever_spec.rb
capistrano-deploy-management-0.1.12 spec/whenever_spec.rb
capistrano-deploy-management-0.1.11 spec/whenever_spec.rb
capistrano-deploy-management-0.1.10 spec/whenever_spec.rb
capistrano-deploy-management-0.1.9 spec/whenever_spec.rb
capistrano-deploy-management-0.1.8 spec/whenever_spec.rb
capistrano-deploy-management-0.1.7 spec/whenever_spec.rb
capistrano-deploy-management-0.1.6 spec/whenever_spec.rb