Sha256: 58411ba82ad249cca24df36a4cb3726eb53317a91334634e3f69e4d4af0c4863

Contents?: true

Size: 1.17 KB

Versions: 3

Compression:

Stored size: 1.17 KB

Contents

describe QME::MapReduce::Executor do

  before :all do
    @bundle_dir = File.join(File.dirname(__FILE__),'../../fixtures/bundle')
    @measure_dir = 'measures'
  end

  before do
    @loader = QME::Database::Loader.new('test')
    @loader.get_db.drop_collection('measures')
    @loader.get_db.drop_collection('bundles')
  end
  
  it 'Should be able to load a bundle' do
    bundle = @loader.save_bundle(@bundle_dir, @measure_dir)
    bundle[:measures].length.should == 1
    bundle[:bundle_data][:extensions].length.should == 3
    bundle[:bundle_data]['name'].should == "test_bundle"
    @loader.get_db['bundles'].count.should == 1
    @loader.get_db['bundles'].find_one['name'].should == 'test_bundle'
  end
  
  
  it 'should be able to remove a bundle' do 
    bundle = @loader.save_bundle(@bundle_dir, @measure_dir)
    bundle_measures_count = bundle[:measures].length
    @loader.get_db['bundles'].count.should == 1
    measures = @loader.get_db['measures'].count
    
    @loader.remove_bundle(bundle[:bundle_data]['_id'])
    @loader.get_db['bundles'].count.should == 0
    measures = @loader.get_db['measures'].count.should == (measures - bundle_measures_count)
    
    
  end
  
 end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
quality-measure-engine-1.1.5 spec/qme/bundle_spec.rb
quality-measure-engine-1.1.3 spec/qme/bundle_spec.rb
quality-measure-engine-1.1.2 spec/qme/bundle_spec.rb