test base class: method for identifying file & returning parsed JSON

This commit is contained in:
Moritz Bunkus 2016-03-27 15:00:12 +02:00
parent cc06e3fa53
commit f21b7ca87d

View File

@ -236,6 +236,17 @@ class SimpleTest
self.sys command, :exit_code => options[:exit_code]
end
def identify_json *args
options = args.extract_options!
fail ArgumentError if args.empty?
command = "../src/mkvmerge --identify --identification-format json --engage no_variable_data #{args.first}"
output, _ = self.sys(command, :exit_code => options[:exit_code])
return JSON.load(output.join(''))
end
def info *args
options = args.extract_options!
fail ArgumentError if args.empty?