test/test_pipeline.rb in tracksperanto-2.12.0 vs test/test_pipeline.rb in tracksperanto-3.0.0

- old
+ new

@@ -30,12 +30,12 @@ Dir.chdir(@old_dir) super end def test_supports_block_init - pipeline = Tracksperanto::Pipeline::Base.new(:middleware_tuples => [:a, :b]) - assert_equal [:a, :b], pipeline.middleware_tuples + pipeline = Tracksperanto::Pipeline::Base.new(:tool_tuples => [:a, :b]) + assert_equal [:a, :b], pipeline.tool_tuples end def test_run_with_autodetected_importer_and_size_without_progress_block create_stabilizer_file pipeline = Tracksperanto::Pipeline::Base.new @@ -85,28 +85,28 @@ f = File.open(empty_file_path, "w"){|f| f.write('xx') } pipeline = Tracksperanto::Pipeline::Base.new assert_raise(Tracksperanto::Pipeline::NoTrackersRecoveredError) { pipeline.run(empty_file_path) } end - def test_middleware_initialization_from_tuples + def test_tool_initialization_from_tuples create_stabilizer_file pipeline = Tracksperanto::Pipeline::Base.new - pipeline.middleware_tuples = [ + pipeline.tool_tuples = [ ["Bla", {:foo=> 234}] ] mock_mux = flexmock("MUX") mock_lint = flexmock("LINT") flexmock(Tracksperanto::Export::Mux).should_receive(:new).and_return(mock_mux) - flexmock(Tracksperanto::Middleware::Lint).should_receive(:new).with(mock_mux).and_return(mock_lint) + flexmock(Tracksperanto::Tool::Lint).should_receive(:new).with(mock_mux).and_return(mock_lint) - m = flexmock("middleware object") - mock_middleware_class = flexmock("middleware class") + m = flexmock("tool object") + mock_tool_class = flexmock("tool class") - flexmock(Tracksperanto).should_receive(:get_middleware).with("Bla").once.and_return(mock_middleware_class) - mock_middleware_class.should_receive(:new).with(mock_lint, {:foo => 234}).once + flexmock(Tracksperanto).should_receive(:get_tool).with("Bla").once.and_return(mock_tool_class) + mock_tool_class.should_receive(:new).with(mock_lint, {:foo => 234}).once assert_raise(NoMethodError) { pipeline.run(@stabilizer) } end def test_run_with_autodetected_importer_that_requires_size @@ -144,10 +144,10 @@ assert_raise(Tracksperanto::Pipeline::DimensionsRequiredError) { pipeline.run("./input.txt", :importer => "Syntheyes") } end def test_importing_file_with_trackers_of_zero_length_does_not_accumulate_any_trackers pft_with_empty_trackers = "./import/samples/pftrack5/empty_trackers.2dt" - i = Tracksperanto::Import::PFTrack.new(:io => File.open(pft_with_empty_trackers)) + i = Tracksperanto::Import::PFTrack.new(:io => File.open(pft_with_empty_trackers), :width => 1920, :height => 1080) tks = i.to_a assert_equal 3, tks.length assert_equal 0, tks[0].length, "The tracker should have 0 keyframes for this test to make sense" FileUtils.cp(pft_with_empty_trackers, "./input_empty.2dt")