|
27 | 27 | it_behaves_like 'a successful exec'
|
28 | 28 | end
|
29 | 29 |
|
| 30 | + where(:method, :expect_output) do |
| 31 | + 'grep' | %w[bar].join("\n") |
| 32 | + 'grep_v' | %w[foo baz].join("\n") |
| 33 | + end |
| 34 | + |
| 35 | + with_them do |
| 36 | + let(:input) do |
| 37 | + <<~INPUT |
| 38 | + foo |
| 39 | + bar |
| 40 | + baz |
| 41 | + INPUT |
| 42 | + end |
| 43 | + let(:args) { %(-s '#{method}(/bar/)') } |
| 44 | + |
| 45 | + it_behaves_like 'a successful exec' |
| 46 | + end |
| 47 | + |
30 | 48 | %w[match m].each do |method|
|
31 | 49 | describe "Container##{method}" do
|
32 | 50 | where do
|
|
214 | 232 | end
|
215 | 233 | end
|
216 | 234 | end
|
217 |
| - |
218 |
| -# describe 'Method' do |
219 |
| -# |
220 |
| -# |
221 |
| -# describe '#sub' do |
222 |
| -# let(:input) { 'foofoo' } |
223 |
| -# let(:output) do |
224 |
| -# <<~OUTPUT |
225 |
| -# barfoo |
226 |
| -# foofoo |
227 |
| -# OUTPUT |
228 |
| -# end |
229 |
| -# |
230 |
| -# before { run_rf(%q('puts sub(/foo/, "bar"); _'), input) } |
231 |
| -# |
232 |
| -# it { expect(last_command_started).to be_successfully_executed } |
233 |
| -# it { expect(last_command_started).to have_output output_string_eq output } |
234 |
| -# end |
235 |
| -# |
236 |
| -# describe '#sub!' do |
237 |
| -# let(:input) { 'foofoo' } |
238 |
| -# let(:output) do |
239 |
| -# <<~OUTPUT |
240 |
| -# barfoo |
241 |
| -# barfoo |
242 |
| -# OUTPUT |
243 |
| -# end |
244 |
| -# |
245 |
| -# before { run_rf(%q('puts sub!(/foo/, "bar"); _'), input) } |
246 |
| -# |
247 |
| -# it { expect(last_command_started).to be_successfully_executed } |
248 |
| -# it { expect(last_command_started).to have_output output_string_eq output } |
249 |
| -# end |
250 |
| -# |
251 |
| -# describe '#tr' do |
252 |
| -# let(:input) { 'foo' } |
253 |
| -# let(:output) do |
254 |
| -# <<~OUTPUT |
255 |
| -# FOO |
256 |
| -# foo |
257 |
| -# OUTPUT |
258 |
| -# end |
259 |
| -# |
260 |
| -# before { run_rf(%q('puts tr("a-z", "A-Z"); _'), input) } |
261 |
| -# |
262 |
| -# it { expect(last_command_started).to be_successfully_executed } |
263 |
| -# it { expect(last_command_started).to have_output output_string_eq output } |
264 |
| -# end |
265 |
| -# |
266 |
| -# describe '#tr!' do |
267 |
| -# let(:input) { 'foo' } |
268 |
| -# let(:output) do |
269 |
| -# <<~OUTPUT |
270 |
| -# FOO |
271 |
| -# FOO |
272 |
| -# OUTPUT |
273 |
| -# end |
274 |
| -# |
275 |
| -# before { run_rf(%q('puts tr!("a-z", "A-Z"); _'), input) } |
276 |
| -# |
277 |
| -# it { expect(last_command_started).to be_successfully_executed } |
278 |
| -# it { expect(last_command_started).to have_output output_string_eq output } |
279 |
| -# end |
280 |
| -# end |
0 commit comments