File: deploy_spec.rb

package info (click to toggle)
ruby-mina 0.3.7-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 444 kB
  • sloc: ruby: 1,630; makefile: 31
file content (40 lines) | stat: -rw-r--r-- 1,036 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
require 'spec_helper'
require 'command_helper'

describe "Invoking the 'mina' command in a project" do
  before :each do
    Dir.chdir root('test_env')
  end

  describe "to do a simulated deploy" do
    before :each do
      mina 'deploy', 'simulate=1'
    end

    it "should take care of the lockfile" do
      expect(stdout).to match(/ERROR: another deployment is ongoing/)
      expect(stdout).to match(/touch ".*deploy\.lock"/)
      expect(stdout).to match(/rm -f ".*deploy\.lock"/)
    end

    it "should honor releases_path" do
      expect(stdout).to include "releases/"
    end

    it "should symlink the current_path" do
      expect(stdout).to match(/ln .*current/)
    end

    it "should include deploy directives" do
      expect(stdout).to include "bundle exec rake db:migrate"
    end

    it "should include 'to :build' directives" do
      stdout.should include "touch build.txt"
    end

    it "should include 'to :launch' directives" do
      expect(stdout).to include "touch tmp/restart.txt"
    end
  end
end