Sha256: fbe7582f94a92a5d02e5b3cde4c012fbc3fa16676bfce92c050ab1f1c8add018
Contents?: true
Size: 984 Bytes
Versions: 15
Compression:
Stored size: 984 Bytes
Contents
module DoorkeeperI18n module Spec module FakeApp # # Starts a new Rails app and runs the given config block before # initializing it # def self.start require 'action_controller/railtie' require 'doorkeeper-i18n' app = Class.new(Rails::Application) app.config.eager_load = false app.config.i18n.enforce_available_locales = false yield(app.config) if block_given? app.initialize! end # # Initialize Rails app in a clean environment. # # @param test [Proc] which have to be run after app is initialized # @return [String] Result of calling +test+ after app was initialized # def self.run(test, &block) r, w = IO.pipe pid = fork do r.close start(&block) w.write(test.call) end w.close result = r.read Process.wait(pid) result end end end end
Version data entries
15 entries across 15 versions & 1 rubygems