Skip to content
This repository has been archived by the owner on Nov 23, 2024. It is now read-only.

Commit

Permalink
Structure test files
Browse files Browse the repository at this point in the history
Nested files under their respective directories now that we've got a
couple tests and the support files are used in more than one place
  • Loading branch information
mriddle committed Apr 3, 2020
1 parent 79d05fb commit c7c0f94
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require 'rake/testtask'
task :default => ['test', 'performance_test']

Rake::TestTask.new(:test) do |test|
test.pattern = 'test/*_test.rb'
test.pattern = 'test/lib/*_test.rb'
test.verbose = true
end

Expand Down
4 changes: 1 addition & 3 deletions test/global_uid_test.rb → test/lib/global_uid_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true
require_relative 'test_helper'
require_relative 'migrations'
require_relative 'models'
require_relative '../support/test_helper'

describe GlobalUid do
before do
Expand Down
4 changes: 1 addition & 3 deletions test/performance/creation_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true
require_relative '../test_helper'
require_relative '../migrations'
require_relative '../models'
require_relative '../support/test_helper'

describe GlobalUid do
before do
Expand Down
File renamed without changes.
File renamed without changes.
7 changes: 5 additions & 2 deletions test/test_helper.rb → test/support/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@
require 'phenix'
require 'pry'

require_relative 'migrations'
require_relative 'models'

Phenix.configure do |config|
config.database_config_path = File.join(File.dirname(__FILE__), "config/database.yml")
config.database_config_path = File.join(File.dirname(__FILE__), "../config/database.yml")
end

Phenix.rise!(with_schema: false)
ActiveRecord::Base.establish_connection(:test)
ActiveRecord::Base.logger = Logger.new(File.dirname(__FILE__) + "/test.log")
ActiveRecord::Base.logger = Logger.new(File.join(File.dirname(__FILE__), "../test.log"))
ActiveSupport.test_order = :sorted if ActiveSupport.respond_to?(:test_order=)
ActiveRecord::Migration.verbose = false

Expand Down

0 comments on commit c7c0f94

Please sign in to comment.