Sha256: 461b6be5ae485f719a16a6fd0e0af1f190d2c9b3322a8ddccf3fff0355fc692f

Contents?: true

Size: 1.39 KB

Versions: 24

Compression:

Stored size: 1.39 KB

Contents

require 'rubygems'
require 'test/unit'
require 'shoulda'
require 'mocks/test/ofac_sdn_loader'

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'ofac'

ActiveRecord::Base.establish_connection :adapter => 'sqlite3', :database => ':memory:'

class Test::Unit::TestCase
  def setup_ofac_sdn_table
    ActiveRecord::Base.connection.tables.each { |table| ActiveRecord::Base.connection.drop_table(table) }
    create_ofac_sdn_table
  end

  private

  def create_ofac_sdn_table
    silence_stream(STDOUT) do
      ActiveRecord::Schema.define(:version => 1) do
        create_table :ofac_sdns do |t|
          t.text      :name
          t.string    :sdn_type
          t.string    :program
          t.string    :title
          t.string    :vessel_call_sign
          t.string    :vessel_type
          t.string    :vessel_tonnage
          t.string    :gross_registered_tonnage
          t.string    :vessel_flag
          t.string    :vessel_owner
          t.text      :remarks
          t.text      :address
          t.string    :city
          t.string    :country
          t.string    :address_remarks
          t.string    :alternate_identity_type
          t.text      :alternate_identity_name
          t.string    :alternate_identity_remarks
          t.timestamps
        end
        add_index :ofac_sdns, :sdn_type
      end
    end
  end

end

Version data entries

24 entries across 24 versions & 2 rubygems

Version Path
kevintyll-ofac-1.1.1 test/test_helper.rb
kevintyll-ofac-1.1.10 test/test_helper.rb
kevintyll-ofac-1.1.11 test/test_helper.rb
kevintyll-ofac-1.1.2 test/test_helper.rb
kevintyll-ofac-1.1.3 test/test_helper.rb
kevintyll-ofac-1.1.4 test/test_helper.rb
kevintyll-ofac-1.1.5 test/test_helper.rb
kevintyll-ofac-1.1.6 test/test_helper.rb
kevintyll-ofac-1.1.7 test/test_helper.rb
kevintyll-ofac-1.1.8 test/test_helper.rb
kevintyll-ofac-1.1.9 test/test_helper.rb
ofac-2.0.1 test/test_helper.rb
ofac-2.0.0 test/test_helper.rb
ofac-1.3.2 test/test_helper.rb
ofac-1.3.1 test/test_helper.rb
ofac-1.3.0 test/test_helper.rb
ofac-1.2.5 test/test_helper.rb
ofac-1.2.4 test/test_helper.rb
ofac-1.2.3 test/test_helper.rb
ofac-1.2.2 test/test_helper.rb