Sha256: 4c25cfc3ae018e082b1b84b1348135e798543b46f7d53b8bad68cd9f6aabb93f

Contents?: true

Size: 1.83 KB

Versions: 10

Compression:

Stored size: 1.83 KB

Contents

require 'spec_helper'
require 'command_helper'
require 'fileutils'
require 'tmpdir'

describe "Invoking the 'mina' command in a project", :ssh => true do
  before :each do
    @path = Dir.mktmpdir
    Dir.chdir @path

    FileUtils.mkdir_p './config'
    FileUtils.cp root('test_env/config/deploy.rb'), './config/deploy.rb'
    FileUtils.rm_rf './deploy'
    FileUtils.mkdir_p './deploy'
  end

  # after :each do
  #   FileUtils.rm_rf @path
  # end

  it 'should set up and deploy fine' do
    print "[setup]" if ENV['verbose']
    mina 'setup', '--verbose'
    File.directory?('deploy').should be_true
    File.directory?('deploy/releases').should be_true
    File.directory?('deploy/shared').should be_true
    File.exists?('deploy/last_version').should be_false
    File.exists?('deploy/deploy.lock').should be_false

    print "[deploy 1]" if ENV['verbose']
    mina 'deploy', '--verbose'
    stdout.should include "-----> Creating a temporary build path"
    stdout.should include "rm -rf .git"
    stdout.should include "mkdir -p"
    File.exists?('deploy/last_version').should be_true
    File.exists?('deploy/deploy.lock').should be_false
    File.directory?('deploy/releases').should be_true
    File.directory?('deploy/releases/1').should be_true
    File.exists?('deploy/releases/1/README.md').should be_true
    File.directory?('deploy/releases/2').should be_false
    File.exists?('deploy/current').should be_true
    File.read('deploy/last_version').strip.should == '1'
    File.exists?('deploy/current/tmp/restart.txt').should be_true

    # And again, to test out sequential versions and stuff
    print "[deploy 2]" if ENV['verbose']
    mina 'deploy'
    stdout.should_not include "rm -rf .git"
    stdout.should_not include "mkdir -p"
    File.directory?('deploy/releases/2').should be_true
    File.read('deploy/last_version').strip.should == '2'
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
mina-0.3.0 spec/commands/real_deploy_spec.rb
mina-0.2.1 spec/commands/real_deploy_spec.rb
mina-0.2.0 spec/commands/real_deploy_spec.rb
mina-0.2.0.pre2 spec/commands/real_deploy_spec.rb
mina-0.1.3.pre1 spec/commands/real_deploy_spec.rb
mina-0.1.2 spec/commands/real_deploy_spec.rb
mina-0.1.2.pre2 spec/commands/real_deploy_spec.rb
mina-0.1.2.pre1 spec/commands/real_deploy_spec.rb
mina-0.1.1 spec/commands/real_deploy_spec.rb
mina-0.1.0 spec/commands/real_deploy_spec.rb