On Tue, Jan 5, 2021 at 10:50 PM Mateusz Urbanski <
[email protected]> wrote:
> I'm loading it in my spec_helper before everything:
Then it must be trying to modify the Database object at runtime, which is a
bad thing. Other than requiring it, you don't seem to be doing anything
else with it. Maybe Fabrication supports a way to configure it so it
doesn't need to modify the Database object at runtime?
>
> # frozen_string_literal: true
>
> # Set RACK_ENV to test.
> ENV['RACK_ENV'] = 'test'
>
> require 'rack/test'
> require 'fabrication'
>
> require_relative '../app'
>
> # Require all files in spec/support folder.
> root_path = Pathname.new(File.expand_path('..', __dir__))
> Dir[root_path.join('spec/support/**/*.rb')].sort.each { |f| require f }
>
> RSpec.configure do |config|
> config.include Rack::Test::Methods, type: :request
> config.include ApiHelpers, type: :request
>
> config.include(Module.new do
> def app
> App.freeze.app
>
This looks weird. You should probably set App.freeze.app to a constant,
and just reference the constant here.
Thanks,
Jeremy
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sequel-talk/CADGZSSfMvA9xUYN-tv4cGNEYFCGREZvUzZS_UWaTbv0WZRAzrA%40mail.gmail.com.