Sha256: 2e59b43779d26af5964d48d5ec6735f54ceade91e16e7a39198a955d30c9f9c6

Contents?: true

Size: 1.06 KB

Versions: 9

Compression:

Stored size: 1.06 KB

Contents

require 'spec_helper'
require 'fileutils'

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')
    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

9 entries across 9 versions & 1 rubygems

Version Path
sniff-0.6.4 spec/lib/sniff/database_spec.rb
sniff-0.6.3 spec/lib/sniff/database_spec.rb
sniff-0.6.2 spec/lib/sniff/database_spec.rb
sniff-0.6.1 spec/lib/sniff/database_spec.rb
sniff-0.6.0 spec/lib/sniff/database_spec.rb
sniff-0.5.3 spec/lib/sniff/database_spec.rb
sniff-0.5.2 spec/lib/sniff/database_spec.rb
sniff-0.5.1 spec/lib/sniff/database_spec.rb
sniff-0.5.0 spec/lib/sniff/database_spec.rb