Sha256: c9846c8c7f44d92b29c67d1b6fd3fd661a407aa6d40aa9639f4949a17b12b8a3

Contents?: true

Size: 1.17 KB

Versions: 31

Compression:

Stored size: 1.17 KB

Contents

require 'spec_helper'

describe RailsBestPractices::Reviews::DryBundlerInCapistranoReview do
  let(:runner) { runner = RailsBestPractices::Core::Runner.new(:reviews => RailsBestPractices::Reviews::DryBundlerInCapistranoReview.new) }

  it "should dry bundler in capistrno" do
    content = <<-EOF
    namespace :bundler do
      task :create_symlink, :roles => :app do
        shared_dir = File.join(shared_path, 'bundle')
        release_dir = File.join(current_release, '.bundle')
        run("mkdir -p \#{shared_dir} && ln -s \#{shared_dir} \#{release_dir}")
      end

      task :bundle_new_release, :roles => :app do
        bundler.create_symlink
        run "cd \#{release_path} && bundle install --without development test"
      end
    end

    after 'deploy:update_code', 'bundler:bundle_new_release'
    EOF
    runner.review('config/deploy.rb', content)
    runner.should have(1).errors
    runner.errors[0].to_s.should == "config/deploy.rb:1 - dry bundler in capistrano"
  end

  it "should not dry bundler in capistrano" do
    content = <<-EOF
      require 'bundler/capistrano'
    EOF
    runner.review('config/deploy.rb', content)
    runner.should have(0).errors
  end
end

Version data entries

31 entries across 31 versions & 3 rubygems

Version Path
rails_best_practices-gorgeouscode-1.0.0 spec/rails_best_practices/reviews/dry_bundler_in_capistrano_review_spec.rb
rails_best_practices-1.9.0 spec/rails_best_practices/reviews/dry_bundler_in_capistrano_review_spec.rb
rails_best_practices-1.8.0 spec/rails_best_practices/reviews/dry_bundler_in_capistrano_review_spec.rb
rails_best_practices-1.7.2 spec/rails_best_practices/reviews/dry_bundler_in_capistrano_review_spec.rb
rails_best_practices-1.7.1 spec/rails_best_practices/reviews/dry_bundler_in_capistrano_review_spec.rb
rails_best_practices-1.7.0 spec/rails_best_practices/reviews/dry_bundler_in_capistrano_review_spec.rb
rails_best_practices-1.6.0 spec/rails_best_practices/reviews/dry_bundler_in_capistrano_review_spec.rb
rails_best_practices-1.5.3 spec/rails_best_practices/reviews/dry_bundler_in_capistrano_review_spec.rb
rails_best_practices-1.5.2 spec/rails_best_practices/reviews/dry_bundler_in_capistrano_review_spec.rb
rails_best_practices-1.5.1 spec/rails_best_practices/reviews/dry_bundler_in_capistrano_review_spec.rb
rails_best_practices-1.5.0 spec/rails_best_practices/reviews/dry_bundler_in_capistrano_review_spec.rb
rails_best_practices-1.4.0 spec/rails_best_practices/reviews/dry_bundler_in_capistrano_review_spec.rb
rails_best_practices-1.3.0 spec/rails_best_practices/reviews/dry_bundler_in_capistrano_review_spec.rb
rails_best_practices-1.2.0 spec/rails_best_practices/reviews/dry_bundler_in_capistrano_review_spec.rb
rails_best_practices-1.1.0 spec/rails_best_practices/reviews/dry_bundler_in_capistrano_review_spec.rb
rails_best_practices-1.0.1 spec/rails_best_practices/reviews/dry_bundler_in_capistrano_review_spec.rb
rails_best_practices-1.0.0 spec/rails_best_practices/reviews/dry_bundler_in_capistrano_review_spec.rb
rails_best_practices-0.10.1 spec/rails_best_practices/reviews/dry_bundler_in_capistrano_review_spec.rb
rails_best_practices-0.10.0 spec/rails_best_practices/reviews/dry_bundler_in_capistrano_review_spec.rb
rails_best_practices-raydog153-0.9.1 spec/rails_best_practices/reviews/dry_bundler_in_capistrano_review_spec.rb