test/lib/docparser/blackbox_test.rb in docparser-0.2.2 vs test/lib/docparser/blackbox_test.rb in docparser-0.2.3
- old
+ new
@@ -1,11 +1,11 @@
require_relative '../../test_helper'
require 'open3'
require 'shellwords'
def cmd_to_sys(command)
- Open3.popen3(command) do |stdin, stdout, stderr|
+ Open3.popen3(command) do |_stdin, stdout, stderr|
[stdout.read, stderr.read]
end
end
describe DocParser do
@@ -16,10 +16,10 @@
example_file = Shellwords.escape(File.join($ROOT_DIR, 'example.rb'))
out, err = cmd_to_sys '/usr/bin/env ruby ' + example_file
err.must_be_empty
rows = out.scan(/(\d+) rows/).flatten
rows.length.must_equal 5
- row_lengths = rows.group_by { |elem| elem.to_i }
+ row_lengths = rows.group_by(&:to_i)
row_lengths.length.must_equal 1
# HaD: 40 pages of 7 articles
row_lengths.keys.first.must_equal(7 * 40)
out.must_match(/Done processing/)
end