test/extra/test_piper.rb in nanoc-3.7.4 vs test/extra/test_piper.rb in nanoc-3.7.5

- old
+ new

@@ -1,19 +1,18 @@ # encoding: utf-8 class Nanoc::Extra::PiperTest < Nanoc::TestCase - def test_basic stdout = StringIO.new stderr = StringIO.new cmd = %w( ls -l ) File.open('foo.txt', 'w') { |io| io.write('hi') } File.open('bar.txt', 'w') { |io| io.write('ho') } - piper = Nanoc::Extra::Piper.new(:stdout => stdout, :stderr => stderr) + piper = Nanoc::Extra::Piper.new(stdout: stdout, stderr: stderr) piper.run(cmd, nil) assert_match(/foo\.txt/, stdout.string) assert_match(/bar\.txt/, stdout.string) assert stderr.string.empty? @@ -24,11 +23,11 @@ stderr = StringIO.new input = 'Hello World!' cmd = %w( cat ) - piper = Nanoc::Extra::Piper.new(:stdout => stdout, :stderr => stderr) + piper = Nanoc::Extra::Piper.new(stdout: stdout, stderr: stderr) piper.run(cmd, input) assert_equal(input, stdout.string) assert_equal('', stderr.string) end @@ -37,12 +36,11 @@ stdout = StringIO.new stderr = StringIO.new cmd = %w( cat kafhawilgoiwaejagoualjdsfilofiewaguihaifeowuiga ) - piper = Nanoc::Extra::Piper.new(:stdout => stdout, :stderr => stderr) + piper = Nanoc::Extra::Piper.new(stdout: stdout, stderr: stderr) assert_raises(Nanoc::Extra::Piper::Error) do piper.run(cmd, nil) end end - end