Skip to content

Commit

Permalink
Add the version command to CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
jefmathiot committed Jan 16, 2015
1 parent f02a3c9 commit edca52e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/electric_sheep/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ def restart
launch_master(:restart!)
end

desc "version", "Show version and git revision"
def version
puts ElectricSheep.revision
end

default_task :work

protected
Expand Down
7 changes: 7 additions & 0 deletions spec/electric_sheep/cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -240,4 +240,11 @@ def self.ensure_startup(action)

end

it 'outputs revision' do
ElectricSheep.expects(:revision).returns('0.0.0 0000000')
cli = subject.new([])
cli.expects(:puts).with('0.0.0 0000000')
cli.send(:version)
end

end

0 comments on commit edca52e

Please sign in to comment.