test/lib/docparser/blackbox_test.rb in docparser-0.2.3 vs test/lib/docparser/blackbox_test.rb in docparser-0.3.0
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
require_relative '../../test_helper'
require 'open3'
require 'shellwords'
def cmd_to_sys(command)
@@ -12,18 +14,17 @@
it 'should run the example without problems' do
curwd = Dir.getwd
Dir.mktmpdir do |dir|
Dir.chdir(dir)
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
+ _, err = cmd_to_sys '/usr/bin/env ruby ' + example_file
+ rows = err.scan(/(\d+) rows/).flatten
rows.length.must_equal 5
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/)
+ err.must_match(/Done processing/)
end
Dir.chdir(curwd)
end
end