Skip to content

Commit

Permalink
Renamed method. Move spec in already existing deploy section.
Browse files Browse the repository at this point in the history
  • Loading branch information
cotsog committed Aug 31, 2017
1 parent c46d5f8 commit 00b3270
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions lib/dpl/provider.rb
Expand Up @@ -151,7 +151,7 @@ def deploy
cleanup
end

deploy
push_app

Array(options[:run]).each do |command|
if command == 'restart'
Expand Down Expand Up @@ -190,7 +190,7 @@ def uncleanup
context.shell "git stash pop"
end

def deploy
def push_app
return if options[:skip_deploy]
context.fold("Deploying application") { push_app }
end
Expand Down
13 changes: 6 additions & 7 deletions spec/provider_spec.rb
Expand Up @@ -94,6 +94,12 @@
allow(provider).to receive_messages(:needs_key? => false)
provider.deploy
end

example "skip deploy" do
expect(provider.options).to receive(:[]).with(:skip_deploy).and_return("true")
expect(provider.context).not_to receive(:fold)
provider.deploy
end
end

describe "#cleanup" do
Expand Down Expand Up @@ -124,13 +130,6 @@
end
end

describe "#deploy" do
example "skip deploy" do
expect(provider.options).to receive(:[]).with(:skip_deploy).and_return("true")
expect(provider.context).not_to receive(:fold)
end
end

describe "#create_key" do
example do
expect(provider.context).to receive(:shell).with('ssh-keygen -t rsa -N "" -C foo -f thekey')
Expand Down

0 comments on commit 00b3270

Please sign in to comment.