Sha256: b9d72c0b60fb05b755eb731ff5cfc575e37329e5c8dd9b0c74a07da3f91d205f

Contents?: true

Size: 1.13 KB

Versions: 10

Compression:

Stored size: 1.13 KB

Contents

require 'spec_helper'
require 'fileutils'
require 'data_miner'
require 'logger'

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 nil
    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
      ZipCode.count.should > 0
      expect { AutomobileFuelType }.should raise_error
    end
    it 'should load data for all domains' do
      Sniff.init(dirigible_path, :earth => :all, :apply_schemas => true)
      PetroleumAdministrationForDefenseDistrict.all.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

10 entries across 10 versions & 1 rubygems

Version Path
sniff-0.8.1 spec/lib/sniff/database_spec.rb
sniff-0.8.0 spec/lib/sniff/database_spec.rb
sniff-0.7.3 spec/lib/sniff/database_spec.rb
sniff-0.7.2 spec/lib/sniff/database_spec.rb
sniff-0.7.1 spec/lib/sniff/database_spec.rb
sniff-0.7.0 spec/lib/sniff/database_spec.rb
sniff-0.6.8 spec/lib/sniff/database_spec.rb
sniff-0.6.7 spec/lib/sniff/database_spec.rb
sniff-0.6.6 spec/lib/sniff/database_spec.rb
sniff-0.6.5 spec/lib/sniff/database_spec.rb