|
69 | 69 | ) |
70 | 70 | end |
71 | 71 |
|
72 | | - it 'with option_one' do |
73 | | - output = capture_output { cli.call(arguments: %w[first_arg --option_one=test2]) } |
| 72 | + it 'with option_one', if: RUBY_VERSION < '2.4' do |
| 73 | + output = capture_output { cli.call(arguments: %w[first_arg --option-one=test2]) } |
74 | 74 | expect(output).to eq( |
75 | 75 | 'mandatory_arg: first_arg. optional_arg: optional_arg. ' \ |
76 | 76 | "Options: {:option_with_default=>\"test\", :option_one=>\"test2\"}\n" |
77 | 77 | ) |
78 | 78 | end |
79 | 79 |
|
| 80 | + it 'with underscored option_one', if: RUBY_VERSION >= '2.4' do |
| 81 | + output = capture_output { cli.call(arguments: %w[first_arg --option_one=test2]) } |
| 82 | + expect(output).to eq( |
| 83 | + 'mandatory_arg: first_arg. optional_arg: optional_arg. ' \ |
| 84 | + "Options: {:option_with_default=>\"test\", :option_one=>\"test2\"}\n" |
| 85 | + ) |
| 86 | + end |
| 87 | + |
80 | 88 | it 'with option_one alias' do |
81 | 89 | output = capture_output { cli.call(arguments: %w[first_arg -1 test2]) } |
82 | 90 | expect(output).to eq( |
|
85 | 93 | ) |
86 | 94 | end |
87 | 95 |
|
88 | | - it 'with boolean_option' do |
89 | | - output = capture_output { cli.call(arguments: %w[first_arg --boolean_option]) } |
| 96 | + it 'with boolean_option', if: RUBY_VERSION < '2.4' do |
| 97 | + output = capture_output { cli.call(arguments: %w[first_arg --boolean-option]) } |
90 | 98 | expect(output).to eq( |
91 | 99 | 'mandatory_arg: first_arg. optional_arg: optional_arg. ' \ |
92 | 100 | "Options: {:option_with_default=>\"test\", :boolean_option=>true}\n" |
93 | 101 | ) |
94 | 102 | end |
95 | 103 |
|
| 104 | + it 'with underscored boolean_option', if: RUBY_VERSION >= '2.4' do |
| 105 | + output = capture_output { cli.call(arguments: %w[first_arg --boolean_option]) } |
| 106 | + expect(output).to eq( |
| 107 | + 'mandatory_arg: first_arg. optional_arg: optional_arg. ' \ |
| 108 | + "Options: {:option_with_default=>\"test\", :boolean_option=>true}\n" |
| 109 | + ) |
| 110 | + end |
| 111 | + |
96 | 112 | it 'with boolean_option alias' do |
97 | 113 | output = capture_output { cli.call(arguments: %w[first_arg -b]) } |
98 | 114 | expect(output).to eq( |
|
101 | 117 | ) |
102 | 118 | end |
103 | 119 |
|
104 | | - it 'with option_with_default alias' do |
105 | | - output = capture_output { cli.call(arguments: %w[first_arg --option_with_default=test3]) } |
| 120 | + it 'with option_with_default alias', if: RUBY_VERSION < '2.4' do |
| 121 | + output = capture_output { cli.call(arguments: %w[first_arg --option-with-default=test3]) } |
106 | 122 | expect(output).to eq( |
107 | 123 | 'mandatory_arg: first_arg. optional_arg: optional_arg. ' \ |
108 | 124 | "Options: {:option_with_default=>\"test3\"}\n" |
109 | 125 | ) |
110 | 126 | end |
111 | 127 |
|
| 128 | + it 'with underscoreed option_with_default alias', if: RUBY_VERSION >= '2.4' do |
| 129 | + output = capture_output { cli.call(arguments: %w[first_arg --option_with_default=test3]) } |
| 130 | + expect(output).to eq( |
| 131 | + 'mandatory_arg: first_arg. optional_arg: optional_arg. ' \ |
| 132 | + "Options: {:option_with_default=>\"test3\"}\n" |
| 133 | + ) |
| 134 | + end |
| 135 | + |
112 | 136 | it 'with combination of aliases' do |
113 | 137 | output = capture_output { cli.call(arguments: %w[first_arg -bd test3]) } |
114 | 138 | expect(output).to eq( |
|
0 commit comments