diff --git a/lib/pry/config/behavior.rb b/lib/pry/config/behavior.rb index a7db8b86..847e5521 100644 --- a/lib/pry/config/behavior.rb +++ b/lib/pry/config/behavior.rb @@ -5,7 +5,7 @@ module Pry::Config::Behavior "[]", "[]=", "merge!", "respond_to?", "key?", "refresh", "forget", "inherited_by", "to_h", - "to_hash", "_dup" + "to_hash", "_dup", "default" ].freeze def self.included(klass) @@ -39,7 +39,7 @@ module Pry::Config::Behavior def []=(key, value) key = key.to_s if RESERVED_KEYS.include?(key) - raise ArgumentError, "sorry, '#{key}' is a reserved configuration key." + raise ArgumentError, "few things are reserved by pry, but using '#{key}' as a configuration key is." end @writes[key] = value end diff --git a/spec/config_spec.rb b/spec/config_spec.rb index a531a370..d3b3ab3d 100644 --- a/spec/config_spec.rb +++ b/spec/config_spec.rb @@ -2,7 +2,7 @@ require_relative 'helper' describe Pry::Config do describe "reserved keys" do it "raises an ArgumentError on assignment of a reserved key" do - local = Pry::Config.from_hash({}) + local = Pry::Config.new Pry::Config::RESERVED_KEYS.each do |key| should.raise(ArgumentError) { local[key] = 1 } end