yads 0.2.0 → 0.3.0.beta

Sign up to get free protection for your applications and to get access to all the features.
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --color
2
+ --format TapFormatter
3
+ --order rand
data/.travis.yml ADDED
@@ -0,0 +1,6 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.8.7
4
+ - 1.9.2
5
+ - 1.9.3
6
+ script: bundle exec rake test
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
1
  source "http://rubygems.org"
2
-
3
- # Specify your gem's dependencies in yads.gemspec
4
2
  gemspec
3
+
4
+ gem "rspec-extra-formatters", :github => "rafaelss/rspec_formatters"
data/README.md CHANGED
@@ -7,7 +7,7 @@ Yet Another Deploy Solution is a simple gem to deploy applications using a singl
7
7
  group :deploy do
8
8
  gem "yads"
9
9
  end
10
-
10
+
11
11
  and
12
12
 
13
13
  bundle install
@@ -22,10 +22,19 @@ and
22
22
 
23
23
  - Run `bundle exec yads deploy` to deploy the code and put your application live
24
24
 
25
+ You can also run single commands by the name defined on your config, like that:
26
+
27
+ bundle exec yads migrate
28
+
29
+ Or
30
+
31
+ bundle exec yads restart
32
+
25
33
  ## TODO
26
34
 
27
- - Let run commands by name: `yads migrate && yads restart` or `yads migrate restart` like rake tasks
35
+ - <del>Let run commands by name: `yads migrate && yads restart` or `yads migrate restart` like rake tasks</del>
28
36
  - Separate commands and tasks. Tasks would be commands you could run alone, any time you want
37
+ - Let run two or more commands at once
29
38
 
30
39
  ## Maintainer
31
40
 
data/bin/yads CHANGED
@@ -1,17 +1,20 @@
1
1
  #!/usr/bin/env ruby
2
- require "slop"
2
+ require 'optparse'
3
3
 
4
- opts = Slop.new(:strict => true)
5
- opts.parse do |action|
6
- require "yads"
7
- deployer = Yads::Deployer.new(STDOUT)
4
+ options = {}
5
+ OptionParser.new do |opts|
6
+ opts.on("-e", "--environment LIBRARY", "Require the LIBRARY before executing your script") do |env|
7
+ options[:environment] = env
8
+ end
9
+ end.parse!
8
10
 
9
- action = action.to_sym
10
- if !action.empty? && deployer.respond_to?(action)
11
- deployer.send(action)
12
- else
13
- puts "Unknow command \"#{action}\""
14
- commands = ["setup", "deploy"].concat(deployer.command_names).join("|")
15
- puts "Usage: yads [#{commands}]"
11
+ require "yads"
12
+ deployer = Yads::Deployer.new(options[:environment], STDOUT)
13
+ if ARGV.empty?
14
+ commands = ["setup", "deploy"].concat(deployer.command_names).join("|")
15
+ puts "Usage: yads [#{commands}]"
16
+ else
17
+ ARGV.each do |cmd|
18
+ deployer.send(cmd)
16
19
  end
17
20
  end
data/lib/yads/deployer.rb CHANGED
@@ -2,8 +2,10 @@ require "yaml"
2
2
 
3
3
  module Yads
4
4
  class Deployer
5
+ CONFIG_FILE = "config/deploy.yml"
5
6
 
6
- def initialize(logger = STDOUT)
7
+ def initialize(environment, logger = STDOUT)
8
+ @environment = environment
7
9
  @logger = logger
8
10
  end
9
11
 
@@ -53,9 +55,14 @@ module Yads
53
55
 
54
56
  def config
55
57
  @config ||= begin
56
- YAML.load(File.open("config/deploy.yml"))
58
+ cfg = YAML.load_file(CONFIG_FILE)
59
+ if @environment
60
+ cfg = cfg[@environment]
61
+ raise Yads::UnknowEnvironment, "Environment #{@environment} is not configured" unless cfg.is_a?(Hash)
62
+ end
63
+ cfg
57
64
  rescue Errno::ENOENT
58
- raise Yads::ConfigNotFound, "config/deploy.yml not found"
65
+ raise Yads::ConfigNotFound, "#{CONFIG_FILE} not found"
59
66
  end
60
67
  end
61
68
 
data/lib/yads/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Yads
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0.beta"
3
3
  end
data/lib/yads.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  module Yads
2
2
  class ConfigNotFound < Errno::ENOENT; end
3
+ class UnknowEnvironment < StandardError; end
3
4
 
4
5
  autoload :SSH, "yads/ssh"
5
6
  autoload :Deployer, "yads/deployer"
File without changes
@@ -0,0 +1,18 @@
1
+ host: rafaelss.com
2
+ user: deploy
3
+ forward_agent: true
4
+ path: /tmp/yads
5
+ repository: git@repohost.com:myrepo.git
6
+ commands:
7
+ migrate: rake db:migrate
8
+ touch: touch test
9
+
10
+ staging:
11
+ host: rafaelss.com
12
+ user: deploy
13
+ forward_agent: true
14
+ path: /tmp/staging/yads
15
+ repository: git@repohost.com:myrepo.git
16
+ commands:
17
+ migrate: rake db:migrate
18
+ touch: touch test
File without changes
@@ -0,0 +1,15 @@
1
+ require "bundler"
2
+ Bundler.require
3
+
4
+ def silence_warnings
5
+ old_verbose, $VERBOSE = $VERBOSE, nil
6
+ yield
7
+ ensure
8
+ $VERBOSE = old_verbose
9
+ end
10
+
11
+ RSpec.configure do |config|
12
+ config.treat_symbols_as_metadata_keys_with_true_values = true
13
+ config.run_all_when_everything_filtered = true
14
+ config.filter_run :focus
15
+ end
@@ -0,0 +1,133 @@
1
+ require "spec_helper"
2
+
3
+ shared_examples_for Yads::Deployer do
4
+ it "returns available commands" do
5
+ inside_project_root do
6
+ subject.command_names.should == ["migrate", "touch"]
7
+ end
8
+ end
9
+
10
+ it "returns if it has a command configured" do
11
+ inside_project_root do
12
+ subject.should respond_to(:migrate)
13
+ end
14
+ end
15
+
16
+ it "executes the command against the server" do
17
+ inside_project_root do
18
+ ssh = mock
19
+ ssh.should_receive(:execute).with("cd #{path} && rake db:migrate")
20
+ Yads::SSH.should_receive(:new).with(:host => "rafaelss.com", :user => "deploy", :forward_agent => true).and_return(ssh)
21
+
22
+ subject.migrate
23
+ end
24
+ end
25
+
26
+ context "setting up" do
27
+ it "raises an error if config is not found" do
28
+ expect do
29
+ Dir.chdir("/tmp") do
30
+ subject.setup
31
+ end
32
+ end.should raise_error(Yads::ConfigNotFound)
33
+ end
34
+
35
+ it "executes commands against the server" do
36
+ inside_project_root do
37
+ ssh = mock
38
+ ssh.should_receive(:execute).with("mkdir -p #{path} && cd #{path} && git clone --depth 1 git@repohost.com:myrepo.git .")
39
+ Yads::SSH.should_receive(:new).with(:host => "rafaelss.com", :user => "deploy", :forward_agent => true).and_return(ssh)
40
+
41
+ subject.setup
42
+ end
43
+ end
44
+ end
45
+
46
+ context "deploying" do
47
+ it "raises an error if config is not found" do
48
+ expect do
49
+ Dir.chdir("/tmp") do
50
+ subject.deploy
51
+ end
52
+ end.should raise_error(Yads::ConfigNotFound)
53
+ end
54
+
55
+ it "executes commands against the server" do
56
+ inside_project_root do
57
+ ssh = mock
58
+ ssh.should_receive(:execute).with("cd #{path} && rake db:migrate && touch test")
59
+ Yads::SSH.should_receive(:new).with(:host => "rafaelss.com", :user => "deploy", :forward_agent => true).and_return(ssh)
60
+
61
+ subject.deploy
62
+ end
63
+ end
64
+ end
65
+ end
66
+
67
+ describe Yads::Deployer do
68
+ let(:log_file) { File.open("/dev/null", "w") }
69
+
70
+ context "without environment" do
71
+ let(:path) { "/tmp/yads" }
72
+ subject { described_class.new(nil, log_file) }
73
+
74
+ before do
75
+ silence_warnings do
76
+ described_class::CONFIG_FILE = "config/deploy.yml"
77
+ end
78
+ end
79
+
80
+ it_behaves_like Yads::Deployer
81
+
82
+ context "using non-standard port" do
83
+ before do
84
+ silence_warnings do
85
+ described_class::CONFIG_FILE = "config/deploy_with_port.yml"
86
+ end
87
+ end
88
+
89
+ it "sets up the app" do
90
+ inside_project_root do
91
+ ssh = mock
92
+ ssh.should_receive(:execute).with("mkdir -p #{path} && cd #{path} && git clone --depth 1 git@repohost.com:myrepo.git .")
93
+ Yads::SSH.should_receive(:new).with(:host => "rafaelss.com", :user => "deploy", :forward_agent => true, :port => 2222).and_return(ssh)
94
+
95
+ subject.setup
96
+ end
97
+ end
98
+
99
+ it "deploys the app" do
100
+ inside_project_root do
101
+ ssh = mock
102
+ ssh.should_receive(:execute).with("cd #{path} && rake db:migrate && touch test")
103
+ Yads::SSH.should_receive(:new).with(:host => "rafaelss.com", :user => "deploy", :forward_agent => true, :port => 2222).and_return(ssh)
104
+
105
+ subject.deploy
106
+ end
107
+ end
108
+ end
109
+ end
110
+
111
+ context "with environment" do
112
+ let(:path) { "/tmp/staging/yads" }
113
+ subject { described_class.new("staging", log_file) }
114
+
115
+ before do
116
+ silence_warnings do
117
+ described_class::CONFIG_FILE = "config/deploy_to_staging.yml"
118
+ end
119
+ end
120
+
121
+ it "raises an error if environment is not configured in config file" do
122
+ expect do
123
+ inside_project_root { described_class.new("production").deploy }
124
+ end.should raise_error(Yads::UnknowEnvironment)
125
+ end
126
+
127
+ it_behaves_like Yads::Deployer
128
+ end
129
+
130
+ def inside_project_root(&block)
131
+ Dir.chdir(File.expand_path("../../fixtures", __FILE__), &block)
132
+ end
133
+ end
@@ -0,0 +1,52 @@
1
+ require "spec_helper"
2
+
3
+ describe Yads::SSH do
4
+ subject { described_class.new(:host => "example.org", :user => "deploy", :forward_agent => true) }
5
+
6
+ it "connects to the server" do
7
+ connection_mock
8
+ subject
9
+ end
10
+
11
+ context "using non-standard port" do
12
+ subject { described_class.new(:host => "example.org", :user => "deploy", :forward_agent => true, :port => 2222) }
13
+
14
+ it "connects to the server" do
15
+ connection_mock(nil, :port => 2222)
16
+ subject
17
+ end
18
+ end
19
+
20
+ it "executes commands against the server" do
21
+ session = mock
22
+ session.should_receive(:exec!).with("mkdir -p /tmp/yads")
23
+ connection_mock(session)
24
+
25
+ subject.execute("mkdir -p /tmp/yads")
26
+ end
27
+
28
+ it "executes commands against the server and yields the output" do
29
+ session = mock
30
+ session.should_receive(:exec).with("echo $PATH").and_yield(nil, nil, "/usr/bin:/usr/local/bin")
31
+ session.should_receive(:loop)
32
+ connection_mock(session)
33
+
34
+ subject.execute("echo $PATH") do |output|
35
+ output.should == "/usr/bin:/usr/local/bin"
36
+ end
37
+ end
38
+
39
+ it "closes the connection with the server" do
40
+ session = mock
41
+ session.should_receive(:close)
42
+ connection_mock(session)
43
+
44
+ subject.close
45
+ end
46
+
47
+ private
48
+
49
+ def connection_mock(session = nil, options = {})
50
+ Net::SSH.should_receive(:start).with("example.org", "deploy", { :forward_agent => true }.merge(options)).and_return(session)
51
+ end
52
+ end
data/yads.gemspec CHANGED
@@ -17,10 +17,8 @@ Gem::Specification.new do |s|
17
17
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
18
18
  s.require_paths = ["lib"]
19
19
 
20
- s.add_runtime_dependency "net-ssh", "~> 2.3.0"
21
- s.add_runtime_dependency "slop", "~> 3.1.1"
20
+ s.add_runtime_dependency "net-ssh", "~> 2.5.2"
22
21
 
23
22
  s.add_development_dependency "rake", ">= 0.8.7"
24
- s.add_development_dependency "minitest", "~> 2.12.1"
25
- s.add_development_dependency "mocha", "~> 0.11.4"
23
+ s.add_development_dependency "rspec", "~> 2.10.0"
26
24
  end
metadata CHANGED
@@ -1,41 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yads
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
5
- prerelease:
4
+ version: 0.3.0.beta
5
+ prerelease: 6
6
6
  platform: ruby
7
7
  authors:
8
8
  - Rafael Souza
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-05 00:00:00.000000000 Z
12
+ date: 2012-06-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: net-ssh
16
- requirement: &70142999344600 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 2.3.0
21
+ version: 2.5.2
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70142999344600
25
- - !ruby/object:Gem::Dependency
26
- name: slop
27
- requirement: &70142999353880 !ruby/object:Gem::Requirement
24
+ version_requirements: !ruby/object:Gem::Requirement
28
25
  none: false
29
26
  requirements:
30
27
  - - ~>
31
28
  - !ruby/object:Gem::Version
32
- version: 3.1.1
33
- type: :runtime
34
- prerelease: false
35
- version_requirements: *70142999353880
29
+ version: 2.5.2
36
30
  - !ruby/object:Gem::Dependency
37
31
  name: rake
38
- requirement: &70142999352620 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
39
33
  none: false
40
34
  requirements:
41
35
  - - ! '>='
@@ -43,29 +37,28 @@ dependencies:
43
37
  version: 0.8.7
44
38
  type: :development
45
39
  prerelease: false
46
- version_requirements: *70142999352620
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: 0.8.7
47
46
  - !ruby/object:Gem::Dependency
48
- name: minitest
49
- requirement: &70142999351400 !ruby/object:Gem::Requirement
47
+ name: rspec
48
+ requirement: !ruby/object:Gem::Requirement
50
49
  none: false
51
50
  requirements:
52
51
  - - ~>
53
52
  - !ruby/object:Gem::Version
54
- version: 2.12.1
53
+ version: 2.10.0
55
54
  type: :development
56
55
  prerelease: false
57
- version_requirements: *70142999351400
58
- - !ruby/object:Gem::Dependency
59
- name: mocha
60
- requirement: &70142999364060 !ruby/object:Gem::Requirement
56
+ version_requirements: !ruby/object:Gem::Requirement
61
57
  none: false
62
58
  requirements:
63
59
  - - ~>
64
60
  - !ruby/object:Gem::Version
65
- version: 0.11.4
66
- type: :development
67
- prerelease: false
68
- version_requirements: *70142999364060
61
+ version: 2.10.0
69
62
  description: Simple deployment tool that uses a single YAML file to put your code
70
63
  live
71
64
  email:
@@ -76,6 +69,8 @@ extensions: []
76
69
  extra_rdoc_files: []
77
70
  files:
78
71
  - .gitignore
72
+ - .rspec
73
+ - .travis.yml
79
74
  - Gemfile
80
75
  - README.md
81
76
  - Rakefile
@@ -85,11 +80,12 @@ files:
85
80
  - lib/yads/deployer.rb
86
81
  - lib/yads/ssh.rb
87
82
  - lib/yads/version.rb
88
- - test/fixtures/config/deploy.yml
89
- - test/fixtures/config/deploy_with_port.yml
90
- - test/test_helper.rb
91
- - test/yads/test_deployer.rb
92
- - test/yads/test_ssh.rb
83
+ - spec/fixtures/config/deploy.yml
84
+ - spec/fixtures/config/deploy_to_staging.yml
85
+ - spec/fixtures/config/deploy_with_port.yml
86
+ - spec/spec_helper.rb
87
+ - spec/yads/deployer_spec.rb
88
+ - spec/yads/ssh_spec.rb
93
89
  - yads.gemspec
94
90
  homepage: http://github.com/rafaelss/yads
95
91
  licenses: []
@@ -106,19 +102,19 @@ required_ruby_version: !ruby/object:Gem::Requirement
106
102
  required_rubygems_version: !ruby/object:Gem::Requirement
107
103
  none: false
108
104
  requirements:
109
- - - ! '>='
105
+ - - ! '>'
110
106
  - !ruby/object:Gem::Version
111
- version: '0'
107
+ version: 1.3.1
112
108
  requirements: []
113
109
  rubyforge_project:
114
- rubygems_version: 1.8.11
110
+ rubygems_version: 1.8.23
115
111
  signing_key:
116
112
  specification_version: 3
117
113
  summary: Deploy your code using a YAML file
118
114
  test_files:
119
- - test/fixtures/config/deploy.yml
120
- - test/fixtures/config/deploy_with_port.yml
121
- - test/test_helper.rb
122
- - test/yads/test_deployer.rb
123
- - test/yads/test_ssh.rb
124
- has_rdoc:
115
+ - spec/fixtures/config/deploy.yml
116
+ - spec/fixtures/config/deploy_to_staging.yml
117
+ - spec/fixtures/config/deploy_with_port.yml
118
+ - spec/spec_helper.rb
119
+ - spec/yads/deployer_spec.rb
120
+ - spec/yads/ssh_spec.rb
data/test/test_helper.rb DELETED
@@ -1,6 +0,0 @@
1
- require "bundler"
2
- Bundler.require
3
-
4
- require "minitest/autorun"
5
- require "mocha"
6
- require "net/ssh"
@@ -1,103 +0,0 @@
1
- require "test_helper"
2
-
3
- class TestYads < MiniTest::Unit::TestCase
4
-
5
- def setup
6
- @log_file = File.open("/dev/null", "w")
7
- end
8
-
9
- def test_try_loading_not_found_config_file_on_setup
10
- assert_raises(Yads::ConfigNotFound) do
11
- Dir.chdir("/tmp") do
12
- deployer = Yads::Deployer.new(@log_file)
13
- deployer.setup
14
- end
15
- end
16
- end
17
-
18
- def test_try_loading_not_found_config_file_on_deploy
19
- assert_raises(Yads::ConfigNotFound) do
20
- Dir.chdir("/tmp") do
21
- deployer = Yads::Deployer.new(@log_file)
22
- deployer.deploy
23
- end
24
- end
25
- end
26
-
27
- def test_setup
28
- inside_project_root do
29
- ssh = mock
30
- ssh.expects(:execute).with("mkdir -p /tmp/yads && cd /tmp/yads && git clone --depth 1 git@repohost.com:myrepo.git .")
31
- Yads::SSH.expects(:new).with(:host => "rafaelss.com", :user => "deploy", :forward_agent => true).returns(ssh)
32
-
33
- deployer = Yads::Deployer.new(@log_file)
34
- deployer.setup
35
- end
36
- end
37
-
38
- def test_setup_using_non_standard_port
39
- inside_project_root do
40
- ssh = mock
41
- ssh.expects(:execute).with("mkdir -p /tmp/yads && cd /tmp/yads && git clone --depth 1 git@repohost.com:myrepo.git .")
42
- Yads::SSH.expects(:new).with(:host => "rafaelss.com", :user => "deploy", :forward_agent => true, :port => 2222).returns(ssh)
43
-
44
- deployer = Yads::Deployer.new(@log_file)
45
- deployer.stubs(:config => YAML.load(File.open("config/deploy_with_port.yml")).merge("port" => 2222))
46
- deployer.setup
47
- end
48
- end
49
-
50
- def test_deploy
51
- inside_project_root do
52
- ssh = mock
53
- ssh.expects(:execute).with("cd /tmp/yads && rake db:migrate && touch test")
54
- Yads::SSH.expects(:new).with(:host => "rafaelss.com", :user => "deploy", :forward_agent => true).returns(ssh)
55
-
56
- deployer = Yads::Deployer.new(@log_file)
57
- deployer.deploy
58
- end
59
- end
60
-
61
- def test_deploy_using_non_standard_port
62
- inside_project_root do
63
- ssh = mock
64
- ssh.expects(:execute).with("cd /tmp/yads && rake db:migrate && touch test")
65
- Yads::SSH.expects(:new).with(:host => "rafaelss.com", :user => "deploy", :forward_agent => true, :port => 2222).returns(ssh)
66
-
67
- deployer = Yads::Deployer.new(@log_file)
68
- deployer.stubs(:config => YAML.load(File.open("config/deploy_with_port.yml")).merge("port" => 2222))
69
- deployer.deploy
70
- end
71
- end
72
-
73
- def test_command_names
74
- inside_project_root do
75
- deployer = Yads::Deployer.new(@log_file)
76
- assert_equal ["migrate", "touch"], deployer.command_names
77
- end
78
- end
79
-
80
- def test_respond_to_command
81
- inside_project_root do
82
- deployer = Yads::Deployer.new(@log_file)
83
- assert deployer.respond_to?(:migrate), "Deployer does not respond to :migrate"
84
- end
85
- end
86
-
87
- def test_execute_the_command
88
- inside_project_root do
89
- ssh = mock
90
- ssh.expects(:execute).with("cd /tmp/yads && rake db:migrate")
91
- Yads::SSH.expects(:new).with(:host => "rafaelss.com", :user => "deploy", :forward_agent => true).returns(ssh)
92
-
93
- deployer = Yads::Deployer.new(@log_file)
94
- deployer.migrate
95
- end
96
- end
97
-
98
- private
99
-
100
- def inside_project_root(&block)
101
- Dir.chdir(File.expand_path("../../fixtures", __FILE__), &block)
102
- end
103
- end
@@ -1,52 +0,0 @@
1
- require "test_helper"
2
-
3
- class TestSSH < MiniTest::Unit::TestCase
4
-
5
- def test_connect
6
- connection_mock
7
-
8
- Yads::SSH.new(:host => "example.org", :user => "deploy", :forward_agent => true)
9
- end
10
-
11
- def test_connect_using_non_standard_port
12
- connection_mock(nil, :port => 2222)
13
-
14
- Yads::SSH.new(:host => "example.org", :port => 2222, :user => "deploy", :forward_agent => true)
15
- end
16
-
17
- def test_execute
18
- session = mock
19
- session.expects(:exec!).with("mkdir -p /tmp/yads")
20
- connection_mock(session)
21
-
22
- s = Yads::SSH.new(:host => "example.org", :user => "deploy", :forward_agent => true)
23
- s.execute("mkdir -p /tmp/yads")
24
- end
25
-
26
- def test_execute_with_block
27
- session = mock
28
- session.expects(:exec).with("echo $PATH").yields(nil, nil, "/usr/bin:/usr/local/bin")
29
- session.expects(:loop)
30
- connection_mock(session)
31
-
32
- s = Yads::SSH.new(:host => "example.org", :user => "deploy", :forward_agent => true)
33
- s.execute("echo $PATH") do |output|
34
- assert_equal "/usr/bin:/usr/local/bin", output
35
- end
36
- end
37
-
38
- def test_close
39
- session = mock
40
- session.expects(:close)
41
- connection_mock(session)
42
-
43
- s = Yads::SSH.new(:host => "example.org", :user => "deploy", :forward_agent => true)
44
- s.close
45
- end
46
-
47
- private
48
-
49
- def connection_mock(session = nil, options = {})
50
- Net::SSH.expects(:start).with("example.org", "deploy", { :forward_agent => true }.merge(options)).returns(session)
51
- end
52
- end