Sha256: ec91f87af42421734ae9dbc60742cc5b1b5b8f5ea7fe5b8aae66cb8191874887

Contents?: true

Size: 1.36 KB

Versions: 19

Compression:

Stored size: 1.36 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',
                              :digital_asset_service_url => 'http://localhost:3000/digital_assets'
  ) }
  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-ssc_deploy.xml')
      DigitalAsset.count.should == 0
      File.stub(:exist?) { true }
      File.stub(:mtime) { Time.now }
      Daengine::TeamsiteMetadataProcessor.should_receive(:process_tuple_file).any_number_of_times
      #expect {
          Daengine::DigitalAssetProcessor.process_tuple_directory 
        #}.to change {DigitalAsset.count}.by_at_least(10)
    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

19 entries across 19 versions & 1 rubygems

Version Path
daengine-0.7.3 spec/lib/digital_asset_processor_spec.rb
daengine-0.7.2 spec/lib/digital_asset_processor_spec.rb
daengine-0.7.1 spec/lib/digital_asset_processor_spec.rb
daengine-0.7 spec/lib/digital_asset_processor_spec.rb
daengine-0.6.23 spec/lib/digital_asset_processor_spec.rb
daengine-0.6.22 spec/lib/digital_asset_processor_spec.rb
daengine-0.6.21 spec/lib/digital_asset_processor_spec.rb
daengine-0.6.20 spec/lib/digital_asset_processor_spec.rb
daengine-0.6.19 spec/lib/digital_asset_processor_spec.rb
daengine-0.6.18 spec/lib/digital_asset_processor_spec.rb
daengine-0.6.17 spec/lib/digital_asset_processor_spec.rb
daengine-0.6.16 spec/lib/digital_asset_processor_spec.rb
daengine-0.6.15 spec/lib/digital_asset_processor_spec.rb
daengine-0.6.14 spec/lib/digital_asset_processor_spec.rb
daengine-0.6.13 spec/lib/digital_asset_processor_spec.rb
daengine-0.6.11 spec/lib/digital_asset_processor_spec.rb
daengine-0.6.10 spec/lib/digital_asset_processor_spec.rb
daengine-0.6.9 spec/lib/digital_asset_processor_spec.rb
daengine-0.6.8 spec/lib/digital_asset_processor_spec.rb