diff options
author | Kyrylo Silin <silin@kyrylo.org> | 2019-04-30 00:48:35 +0300 |
---|---|---|
committer | Kyrylo Silin <silin@kyrylo.org> | 2019-04-30 01:28:28 +0300 |
commit | 1e2cfbb7f9d7f2cc3e46dd7ab96bf6b4ee151f56 (patch) | |
tree | 46b88fa2e7eda94711e1b88d2fb557bf0c7a479c /spec | |
parent | af1c0664df0fc043ba27b32f6b7d376ab7bae6a9 (diff) | |
download | pry-1e2cfbb7f9d7f2cc3e46dd7ab96bf6b4ee151f56.tar.gz |
Reduce the influence of Pry::Config
This is one of preliminary steps for #1843 (Rework the Pry config).
In this commit we replace calls to `Pry::Config` where possible, therefore we
reduce coupling between the config and other components.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/commands/cd_spec.rb | 2 | ||||
-rw-r--r-- | spec/hooks_spec.rb | 2 | ||||
-rw-r--r-- | spec/spec_helper.rb | 5 |
3 files changed, 4 insertions, 5 deletions
diff --git a/spec/commands/cd_spec.rb b/spec/commands/cd_spec.rb index 38830ace..ae715a3a 100644 --- a/spec/commands/cd_spec.rb +++ b/spec/commands/cd_spec.rb @@ -129,7 +129,7 @@ describe 'cd' do describe 'when using ^D (Control-D) key press' do it 'should keep correct old binding' do @t.eval 'cd :john_dogg', 'cd :mon_dogg', 'cd :kyr_dogg', - 'Pry::Config.defaults.control_d_handler.call("", pry_instance)' + 'Pry.config.control_d_handler.call("", pry_instance)' expect(@t.mapped_binding_stack).to eq [@o, :john_dogg, :mon_dogg] @t.eval 'cd -' diff --git a/spec/hooks_spec.rb b/spec/hooks_spec.rb index 5ee30b80..465ed236 100644 --- a/spec/hooks_spec.rb +++ b/spec/hooks_spec.rb @@ -411,7 +411,7 @@ describe Pry::Hooks do describe "after_session hook" do it 'should always run, even if uncaught exception bubbles out of repl' do - o = Pry::Config.new + o = OpenStruct.new o.great_escape = Class.new(StandardError) old_ew = Pry.config.unrescued_exceptions diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index a0b0c848..b6111e27 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -9,6 +9,7 @@ require 'rspec' require 'pry/testable' require 'English' require 'stringio' +require 'ostruct' Dir['./spec/support/**/*.rb'].map do |file| require file @@ -22,9 +23,7 @@ class Module # rubocop:enable Style/AccessModifierDeclarations end -Pad = Class.new do - include Pry::Config::Behavior -end.new(nil) +Pad = OpenStruct.new # to help with tracking down bugs that cause an infinite loop in the test suite if ENV["SET_TRACE_FUNC"] |