From efe320711b7b7ff261ce442409383ca39ba62b98 Mon Sep 17 00:00:00 2001 From: Emelia Smith Date: Wed, 2 Oct 2024 21:36:11 +0200 Subject: [PATCH 1/2] Improve developer experience by enabling interactive debugging in the tests and console --- Gemfile | 5 +++++ bin/console | 10 ++-------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Gemfile b/Gemfile index 346bc323d..03399e08e 100644 --- a/Gemfile +++ b/Gemfile @@ -27,3 +27,8 @@ gem "sqlite3", "~> 1.4", platform: [:ruby, :mswin, :mingw, :x64_mingw] gem "tzinfo-data", platforms: %i[mingw mswin x64_mingw] gem "timecop" + +gem 'irb', '~> 1.8' + +# Interactive Debugging tools +gem 'debug', '~> 1.8' diff --git a/bin/console b/bin/console index 019ffb0df..df716fecf 100755 --- a/bin/console +++ b/bin/console @@ -4,15 +4,10 @@ require "bundler/setup" require "rails/all" require "active_support/all" +require "irb" +require "debug" require "doorkeeper" -# You can add fixtures and/or initialization code here to make experimenting -# with your gem easier. You can also use a different console, if you like. - -# (If you use this, don't forget to add pry to your Gemfile!) -# require "pry" -# Pry.start - Rails.logger = Logger.new(STDOUT) Rails.logger.info("Doorkeeper version: #{Doorkeeper::VERSION::STRING}") @@ -32,5 +27,4 @@ ActiveRecord::Base.establish_connection( # Load database schema load File.expand_path("../spec/dummy/db/schema.rb", __dir__) -require "irb" IRB.start(__FILE__) From b4bd6803147934d41d0d19642ef8e97d48984090 Mon Sep 17 00:00:00 2001 From: Emelia Smith Date: Wed, 2 Oct 2024 21:36:35 +0200 Subject: [PATCH 2/2] Fix warning in tests for action_dispatch.show_exceptions --- spec/dummy/config/environments/test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/dummy/config/environments/test.rb b/spec/dummy/config/environments/test.rb index b184dff9f..240b92ec6 100644 --- a/spec/dummy/config/environments/test.rb +++ b/spec/dummy/config/environments/test.rb @@ -23,7 +23,7 @@ config.action_controller.perform_caching = false # Raise exceptions instead of rendering exception templates - config.action_dispatch.show_exceptions = false + config.action_dispatch.show_exceptions = :none # Disable request forgery protection in test environment config.action_controller.allow_forgery_protection = false