Sha256: 09f6a4413ceb796ac79d72403eb23169a95e2c1a11e381598818366d1df349f7

Contents?: true

Size: 1.1 KB

Versions: 3

Compression:

Stored size: 1.1 KB

Contents

require 'spec_helper'

describe Sniff::Database do
  describe '#connect' do
    let(:dirigible_path) { File.expand_path '../../fixtures/dirigible', File.dirname(__FILE__) }
    
    before :all do
      $:.unshift File.join(dirigible_path, 'lib')
      require File.join('dirigible')
      DataMiner.logger = Logger.new $stdout
    end

    it 'should load the air domain' do
      Sniff.init(dirigible_path, :earth => :air, :apply_schemas => true)
      Airport.count.should == 0 # we don't have fixtures for this here
      expect { ZipCode.count }.should raise_error
      expect { AutomobileFuelType.count }.should raise_error
    end
    it 'should load data for all domains' do
      Sniff.init(dirigible_path, :earth => :all, :apply_schemas => true)
      PetroleumAdministrationForDefenseDistrict.count.should == 7
      ZipCode.count.should > 0
    end
    it 'should load a schema for the emitter record' do
      Sniff.init(dirigible_path, :apply_schemas => true)
      require File.join(dirigible_path, 'lib', 'test_support', 'dirigible_record')
      DirigibleRecord.table_exists?.should be_true
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sniff-0.8.4 spec/lib/sniff/database_spec.rb
sniff-0.8.3 spec/lib/sniff/database_spec.rb
sniff-0.8.2 spec/lib/sniff/database_spec.rb