Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jochen
gitlab-irc
Commits
56e8f719
Commit
56e8f719
authored
Jan 10, 2014
by
nTraum
Browse files
added test for version output
parent
34032cce
Changes
3
Hide whitespace changes
Inline
Side-by-side
lib/gitlab-irc/cli.rb
View file @
56e8f719
...
...
@@ -2,7 +2,7 @@ require 'optparse'
module
GitlabIrc
class
Cli
def
initialize
(
arg
v
)
def
initialize
(
arg
s
)
@options
=
{}
OptionParser
.
new
do
|
opts
|
...
...
@@ -15,13 +15,11 @@ module GitlabIrc
opts
.
on
(
'-v'
,
'--version'
,
'Display program version'
)
do
puts
"gitlab-irc
#{
GitlabIrc
::
VERSION
}
"
exit
end
opts
.
on
(
'-h'
,
'--help'
,
'Display this screen'
)
do
puts
opts
exit
end
end
.
parse!
end
.
parse!
(
args
)
end
end
end
\ No newline at end of file
test/gitlab-irc/cli_test.rb
View file @
56e8f719
require_relative
'../test_helper'
describe
Cli
do
it
'must have the correct version'
do
GitlabIrc
::
VERSION
.
must_equal
'0.1'
,
'wrong gem version'
describe
'version flag'
do
it
'recognizes the short style switch'
do
proc
{
Cli
.
new
[
'-v'
]
}.
must_output
/^gitlab-irc \d+(\.\d+)*$/
end
it
'recognizes the long style switch'
do
proc
{
Cli
.
new
[
'--version'
]
}.
must_output
/^gitlab-irc \d+(\.\d+)*$/
end
end
end
\ No newline at end of file
test/test_helper.rb
View file @
56e8f719
...
...
@@ -3,6 +3,7 @@ Coveralls.wear!
require
'minitest/autorun'
require
'minitest/pride'
require
File
.
expand_path
(
'../../lib/gitlab-irc.rb'
,
__FILE__
)
include
GitlabIrc
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment