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:
parent
b495af23cf
commit
76d4f03934
2 changed files with 12 additions and 0 deletions
|
@ -91,6 +91,10 @@ module Pry::Config::Behavior
|
||||||
end
|
end
|
||||||
alias_method :eql?, :==
|
alias_method :eql?, :==
|
||||||
|
|
||||||
|
def keys
|
||||||
|
@writes.keys
|
||||||
|
end
|
||||||
|
|
||||||
def to_hash
|
def to_hash
|
||||||
@writes.dup
|
@writes.dup
|
||||||
end
|
end
|
||||||
|
|
|
@ -51,6 +51,14 @@ describe Pry::Config do
|
||||||
end
|
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
|
describe "#==" do
|
||||||
it "compares equality through the underlying lookup table" do
|
it "compares equality through the underlying lookup table" do
|
||||||
local1 = Pry::Config.new(nil)
|
local1 = Pry::Config.new(nil)
|
||||||
|
|
Loading…
Reference in a new issue