Skip to content

Commit

Permalink
Made it easier to test non-query methods
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Feb 6, 2021
1 parent a164cb2 commit 5c03f2d
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion test/query_methods/mongoid_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require_relative "../test_helper"
require_relative "query_methods_helper"

class MongoidEvent
include Mongoid::Document
Expand Down
2 changes: 1 addition & 1 deletion test/query_methods/mysql_json_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require_relative "../test_helper"
require_relative "query_methods_helper"

class MysqlJsonEvent < MysqlBase
serialize :properties, JSON if connection.send(:mariadb?)
Expand Down
2 changes: 1 addition & 1 deletion test/query_methods/mysql_text_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require_relative "../test_helper"
require_relative "query_methods_helper"

class MysqlTextEvent < MysqlBase
serialize :properties, JSON
Expand Down
2 changes: 1 addition & 1 deletion test/query_methods/postgresql_hstore_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require_relative "../test_helper"
require_relative "query_methods_helper"

class PostgresqlHstoreEvent < PostgresqlBase
end
Expand Down
2 changes: 1 addition & 1 deletion test/query_methods/postgresql_json_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require_relative "../test_helper"
require_relative "query_methods_helper"

class PostgresqlJsonEvent < PostgresqlBase
end
Expand Down
2 changes: 1 addition & 1 deletion test/query_methods/postgresql_jsonb_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require_relative "../test_helper"
require_relative "query_methods_helper"

class PostgresqlJsonbEvent < PostgresqlBase
end
Expand Down
2 changes: 1 addition & 1 deletion test/query_methods/postgresql_text_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require_relative "../test_helper"
require_relative "query_methods_helper"

class PostgresqlTextEvent < PostgresqlBase
serialize :properties, JSON
Expand Down
11 changes: 11 additions & 0 deletions test/query_methods/query_methods_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
require_relative "../test_helper"

# run setup / migrations
require_relative "../support/mysql"
require_relative "../support/postgresql"
require_relative "../support/mongoid"

# restore connection
ActiveRecord::Base.establish_connection(:test)

require_relative "../support/query_methods_test"
10 changes: 0 additions & 10 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,6 @@

Ahoy.logger = logger

# run setup / migrations
require_relative "support/mysql"
require_relative "support/postgresql"
require_relative "support/mongoid"

# restore connection
ActiveRecord::Base.establish_connection(:test)

require_relative "support/query_methods_test"

class Minitest::Test
def with_options(options)
previous_options = {}
Expand Down

0 comments on commit 5c03f2d

Please sign in to comment.