diff --git a/lib/pry/config/behavior.rb b/lib/pry/config/behavior.rb index 29eea187..d72d7afa 100644 --- a/lib/pry/config/behavior.rb +++ b/lib/pry/config/behavior.rb @@ -91,6 +91,10 @@ module Pry::Config::Behavior end alias_method :eql?, :== + def keys + @writes.keys + end + def to_hash @writes.dup end diff --git a/spec/config_spec.rb b/spec/config_spec.rb index bfbaaa89..aa38a1bc 100644 --- a/spec/config_spec.rb +++ b/spec/config_spec.rb @@ -51,6 +51,14 @@ describe Pry::Config do end + describe "#keys" do + it "returns an array of local keys" do + root = Pry::Config.from_hash({zoo: "boo"}, nil) + local = Pry::Config.from_hash({foo: "bar"}, root) + local.keys.should == ["foo"] + end + end + describe "#==" do it "compares equality through the underlying lookup table" do local1 = Pry::Config.new(nil)