coulis 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/lib/coulis.rb +1 -1
  2. data/test/coulis_test.rb +6 -0
  3. metadata +2 -2
@@ -34,7 +34,7 @@ class Coulis
34
34
  definition.call
35
35
  else
36
36
  arg_name = "#{"-" if m[0..0] != "-"}#{m}"
37
- arg_name = "-" + arg_name if arg_name.size > 2
37
+ arg_name = "-" + arg_name.gsub("_", "-") if arg_name.size > 2
38
38
 
39
39
  if args.to_s.empty?
40
40
  @args << [ definition || arg_name ]
@@ -70,6 +70,12 @@ class SimpleCliTest < Test::Unit::TestCase
70
70
  assert_equal ls.args.to_s, "--color"
71
71
  end
72
72
 
73
+ def test_not_defined_long_argument_with_underscore
74
+ ls = Ls.options { color_test }
75
+ assert_equal ls.args.size, 1
76
+ assert_equal ls.args.to_s, "--color-test"
77
+ end
78
+
73
79
  def test_command
74
80
  assert_equal Ls.options { full; s }.command, "ls -a -h -s"
75
81
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 1
9
- version: 0.1.1
8
+ - 2
9
+ version: 0.1.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Bruno Celeste