test/test_cli.rb in tracksperanto-2.3.2 vs test/test_cli.rb in tracksperanto-2.3.3
- old
+ new
@@ -1,6 +1,7 @@
require File.expand_path(File.dirname(__FILE__)) + '/helper'
+require "set"
class CliTest < Test::Unit::TestCase
TEMP_DIR = File.expand_path(File.dirname(__FILE__) + "/tmp")
BIN_P = File.expand_path(File.dirname(__FILE__) + "/../bin/tracksperanto")
@@ -51,25 +52,31 @@
flm.stabilizer flm_3de_v3.txt flm_3de_v4.txt flm_boujou_text.txt flm_flame.stabilizer
flm_matchmover.rz2 flm_mayalive.txt flm_nuke.nk flm_pfmatchit.txt flm_pftrack_v4.2dt
flm_pftrack_v5.2dt flm_shake_trackers.txt flm_syntheyes_2dt.txt
)
- assert_equal fs, Dir.entries(TEMP_DIR)
+ assert_same_set fs, Dir.entries(TEMP_DIR)
end
def test_cli_with_only_option
FileUtils.cp(File.dirname(__FILE__) + "/import/samples/flame_stabilizer/fromCombustion_fromMidClip_wSnap.stabilizer", TEMP_DIR + "/flm.stabilizer")
cli("#{BIN_P} --only syntheyes #{TEMP_DIR}/flm.stabilizer")
fs = %w(. .. flm.stabilizer flm_syntheyes_2dt.txt )
- assert_equal fs, Dir.entries(TEMP_DIR)
+ assert_same_set fs, Dir.entries(TEMP_DIR)
end
def test_cli_reformat
FileUtils.cp(File.dirname(__FILE__) + "/import/samples/flame_stabilizer/fromCombustion_fromMidClip_wSnap.stabilizer", TEMP_DIR + "/flm.stabilizer")
cli("--reformat-x 1204 --reformat-y 340 --only flamestabilizer #{TEMP_DIR}/flm.stabilizer")
p = Tracksperanto::Import::FlameStabilizer.new(:io => File.open(TEMP_DIR + "/flm_flame.stabilizer"))
items = p.to_a
assert_equal 1204, p.width, "The width of the converted setup should be that"
assert_equal 340, p.height, "The height of the converted setup should be that"
+ end
+
+ # We use this instead of assert_equals for arrays since different filesystems
+ # return files in different order
+ def assert_same_set(expected_enum, enum, message = "Should be the same set")
+ assert_equal Set.new(expected_enum), Set.new(enum), message
end
end
\ No newline at end of file