|
27 | 27 | it_behaves_like 'a successful exec'
|
28 | 28 | end
|
29 | 29 |
|
| 30 | + where(:command, :expect_output) do |
| 31 | + 'grep(/foo/)' | %w[foo].join("\n") |
| 32 | + 'grep_v(/bar/)' | %w[foo baz].join("\n") |
| 33 | + 'grep(/foo/){|i| i + "hoge" }' | %w[foohoge].join("\n") |
| 34 | + 'grep_v(/bar/){|i| i+ "hoge" }' | %w[foohoge bazhoge].join("\n") |
| 35 | + end |
| 36 | + |
| 37 | + with_them do |
| 38 | + let(:input) { %w[foo bar baz].join("\n") } |
| 39 | + let(:args) { %(-s '#{command}') } |
| 40 | + |
| 41 | + it_behaves_like 'a successful exec' |
| 42 | + end |
| 43 | + |
30 | 44 | %w[match m].each do |method|
|
31 | 45 | describe "Container##{method}" do
|
32 | 46 | where do
|
|
214 | 228 | end
|
215 | 229 | end
|
216 | 230 | 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