Sha256: cd282ae2c83320e4ad40f392765b1f44d615f0372b64123721679465d0cde301
Contents?: true
Size: 1.33 KB
Versions: 3
Compression:
Stored size: 1.33 KB
Contents
# encoding: utf-8 require 'spec_helper' describe Ffprober::FfprobeVersion do VERSION_CHECKS = [ { version: "0.9.0", pass: true }, { version: "1.0.0", pass: true }, { version: "1.1.0", pass: true }, { version: "1.9.0", pass: false }, { version: "1.2.1", pass: true } ] context 'validates the ffprobe version' do VERSION_CHECKS.each do |check| it "detects version #{check[:version]}" do Ffprober::FfprobeVersion.any_instance.stub(:version) { Gem::Version.new(check[:version]) } Ffprober::FfprobeVersion.valid?.should be(check[:pass]) end end end describe 'detects the version of ffprobe' do Dir.new("spec/assets/version_outputs").each do |entry| next if [".", "..", ".DS_Store"].include?(entry) os, expected_version = entry.split("-") it "on #{os} from #{expected_version}" do version_output = File.read("spec/assets/version_outputs/" + entry) Ffprober::FfprobeVersion.any_instance.stub(:version_output) { version_output } version_check = Ffprober::FfprobeVersion.new if expected_version == "nightly" version_check.nightly?.should eq(true) version_check.valid?.should eq(true) else version_check.version.should eq(Gem::Version.new(expected_version.gsub("_", "."))) end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
ffprober-0.3.2 | spec/ffprober/ffprobe_version_spec.rb |
ffprober-0.3.1 | spec/ffprober/ffprobe_version_spec.rb |
ffprober-0.3.0 | spec/ffprober/ffprobe_version_spec.rb |