Skip to content

Commit

Permalink
chore: Fix deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
hasghari committed Aug 14, 2024
1 parent 7ddd609 commit 5c15357
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions spec/dummy/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ class Application < Rails::Application
if Rails.version.match?(/(6.1|7.0)/)
config.active_record.legacy_connection_handling = false
end

if Rails.gem_version >= Gem::Version.new("7.1")
config.active_support.cache_format_version = 7.0
end

config.active_support.deprecation = :stderr
config.eager_load = false

Expand Down
11 changes: 11 additions & 0 deletions spec/support/generator_spec_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
require "ammeter/init"

module GeneratorSpecHelpers
module FileMethods
def file(path)
Pathname.new(super)
end

def migration_file(path)
Pathname.new(super)
end
end

TEMPLATE_PATH = File.expand_path("../../app_templates", __FILE__)

def provide_existing_routes_file
Expand Down Expand Up @@ -36,6 +46,7 @@ def copy_to_generator_root(destination, template)

RSpec.configure do |config|
config.include GeneratorSpecHelpers
config.prepend GeneratorSpecHelpers::FileMethods

config.before(:example, :generator) do
destination File.expand_path("../../../tmp", __FILE__)
Expand Down

0 comments on commit 5c15357

Please sign in to comment.