require 'spec_helper' describe Daengine::DigitalAssetProcessor do before { Daengine.configure(:assets_path => Dir.pwd+'/spec/mock_data', :daengine_yml_file => Dir.pwd+'/spec/mock_data/daengine.yml' ) } context "process_tuple_directory" do it 'processes only files modified in the last 2 days' do # process bulk deploy file in the mock dir DigitalAsset.destroy_all before = DigitalAsset.count FileUtils.touch Dir.pwd+'/spec/mock_data/bulk-ssc_deploy.xml' before = DigitalAsset.count Daengine::DigitalAssetProcessor.process_tuple_directory after = DigitalAsset.count (after - before).should > 1500 end it 'processes only those files that modified since the last time the daengine process ran' do # process any files that has modified since last run. None !! before = DigitalAsset.count Daengine::DigitalAssetProcessor.process_tuple_directory after = DigitalAsset.count (after - before).should == 0 end end end