Skip to content

Remove legacy code in specs #414

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ Gemfile.lock

# Ignore db files
*.sqlite3
# Ignore temprary db files
*.sqlite3-shm
*.sqlite3-wal

# Ignore editor files
.idea
6 changes: 0 additions & 6 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
require 'faker'
require 'threads'

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

require 'meilisearch-rails'
require 'rspec'
require 'rails/all'
Expand All @@ -39,9 +36,6 @@
# Required for serializing objects similar to production environments
GlobalID.app = 'meilisearch-test'

OLD_RAILS = Gem.loaded_specs['rails'].version < Gem::Version.new('4.0')
NEW_RAILS = Gem.loaded_specs['rails'].version >= Gem::Version.new('6.0')

Dir["#{File.dirname(__FILE__)}/support/*.rb"].each { |file| require file }

RSpec.configure do |c|
Expand Down
8 changes: 1 addition & 7 deletions spec/support/active_record_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,7 @@

ActiveRecord::Base.raise_in_transactional_callbacks = true if ActiveRecord::Base.respond_to?(:raise_in_transactional_callbacks)

FileUtils.rm('data.sqlite3') if File.exist?('data.sqlite3')

unless OLD_RAILS || NEW_RAILS
require 'active_job/test_helper'

ActiveJob::Base.queue_adapter = :test
end
FileUtils.rm_f('data.sqlite3')

def ar_schema
@ar_schema ||= ActiveRecord::Schema.new
Expand Down
2 changes: 1 addition & 1 deletion spec/support/sequel_db.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ def sequel_db
end)
end

FileUtils.rm('sequel_data.sqlite3') if File.exist?('sequel_data.sqlite3')
FileUtils.rm_f('sequel_data.sqlite3')
Loading