1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

add Behavior#keys.

This commit is contained in:
Robert Gleeson 2014-02-02 23:23:23 +01:00
parent b495af23cf
commit 76d4f03934
2 changed files with 12 additions and 0 deletions

View file

@ -91,6 +91,10 @@ module Pry::Config::Behavior
end
alias_method :eql?, :==
def keys
@writes.keys
end
def to_hash
@writes.dup
end

View file

@ -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)