Add version CLI option

This commit is contained in:
Thibault Jouan
2015-04-18 17:03:25 +00:00
parent dcc41006d0
commit 71caf160be
4 changed files with 32 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
Feature: version CLI option
Scenario: prints the current version on standard output
When I run uhwm with option --version
Then uhwm must terminate successfully
And the output must contain exactly the version

View File

@@ -10,9 +10,15 @@ options:
-r, --require PATH require ruby feature
-l, --layout LAYOUT specify layout
-w, --worker WORKER specify worker
-V, --version print version
eoh
end
Then /^the output must contain exactly the version$/ do
#require File.expand_path('../lib/uh/wm/version', __FILE__)
assert_exact_output "%s\n" % Uh::WM::VERSION, all_output
end
Then /^the output must match \/([^\/]+)\/([a-z]*)$/ do |pattern, options|
uhwm_wait_output Regexp.new(pattern, options)
end