Sha256: accb566d3c8ea0e12e8a68d41bfc42b8b63961d6e910cd50a5dd067e074c9333

Contents?: true

Size: 1.16 KB

Versions: 3

Compression:

Stored size: 1.16 KB

Contents

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',
                              :digital_assets_file_directory => Dir.pwd + '/spec/mock_data/files'
  ) }
  context "process_tuple_directory" do
    it 'processes only files modified in the last 2 days' do
    # process bulk deploy file in the mock dir
      FileUtils.touch Dir.glob(Dir.pwd+'/spec/mock_data/bulk*.xml')
      DigitalAsset.count.should == 0
      File.stub(:exist?) { true }
      File.stub(:mtime) { Time.now }
      expect {
          Daengine::DigitalAssetProcessor.process_tuple_directory 
        }.to change {DigitalAsset.count}.by_at_least(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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
daengine-0.3.5 spec/lib/digital_asset_processor_spec.rb
daengine-0.3.4 spec/lib/digital_asset_processor_spec.rb
daengine-0.3.3 spec/lib/digital_asset_processor_spec.rb