Sha256: 2854c8955d812b5ab700629d5ff2804e0a93e1f8c2c94261c845e51cb7bb1642
Contents?: true
Size: 947 Bytes
Versions: 1
Compression:
Stored size: 947 Bytes
Contents
require 'active_support/core_ext' require 'active_record' require 'fileutils' tmpdir = File.join(File.dirname(__FILE__), '..', '..', 'tmp') FileUtils.mkdir(tmpdir) unless File.exist?(tmpdir) test_db = File.join(tmpdir, 'test.db') connection_spec = { :adapter => 'sqlite3', :database => test_db } # Delete any existing instance of the test database FileUtils.rm test_db, :force => true # Create a new test database ActiveRecord::Base.establish_connection(connection_spec) # ActiveRecord::Base.connection.initialize_schema_migrations_table class CreateMeasurements < ActiveRecord::Migration def self.up create_table :system_metrics, :force => true do |t| t.string :name t.datetime :started_at t.string :transaction_id t.text :payload t.float :duration t.integer :request_id t.integer :parent_id end end def self.down drop_table :system_metrics end end CreateMeasurements.up
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
system-metrics-0.1.0 | spec/support/db_setup.rb |