Skip to content

Commit

Permalink
Merge pull request #1019 from bruno-/tweak_revision_log
Browse files Browse the repository at this point in the history
Update dsl#local_user method
  • Loading branch information
leehambley committed Apr 22, 2014
2 parents 53957e7 + 6e670fc commit 25a0262
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Reverse Chronological Order:
https://github.com/capistrano/capistrano/compare/v3.2.0...HEAD

* Minor changes:
* Update dsl#local_user method and add test for it. (@bruno-)
* Revert short sha1 revision with git. (@blaugueux)
* Changed asking question to more standard format (like common unix commandline tools) (@sponomarev)
* Fixed typos in the README. (@sponomarev)
Expand Down
3 changes: 2 additions & 1 deletion lib/capistrano/dsl.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require 'etc'
require 'capistrano/dsl/task_enhancements'
require 'capistrano/dsl/paths'
require 'capistrano/dsl/stages'
Expand Down Expand Up @@ -41,7 +42,7 @@ def rollback_log_message
end

def local_user
`whoami`
Etc.getlogin
end

def lock(locked_version)
Expand Down
11 changes: 11 additions & 0 deletions spec/lib/capistrano/dsl_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,16 @@ class DummyDSL
dsl.sudo(:my, :command)
end
end

describe '#local_user' do

before do
Etc.expects(:getlogin)
end

it 'delegates to Etc#getlogin' do
dsl.local_user
end
end
end
end

0 comments on commit 25a0262

Please sign in to comment.