Lands #4842, makes datastore.delete() case insensitive.
commit
302458652c
|
@ -43,6 +43,13 @@ class DataStore < Hash
|
|||
super(find_key_case(k), v)
|
||||
end
|
||||
|
||||
#
|
||||
# Case-insensitive wrapper around delete
|
||||
#
|
||||
def delete(k)
|
||||
super(find_key_case(k))
|
||||
end
|
||||
|
||||
|
||||
#
|
||||
# Updates a value in the datastore with the specified name, k, to the
|
||||
|
|
|
@ -24,6 +24,11 @@ shared_examples "datastore" do
|
|||
subject.to_h.should == { "foo" => "bar", "fizz" => "buzz" }
|
||||
end
|
||||
end
|
||||
context "#delete" do
|
||||
it "should delete the specified key" do
|
||||
subject.delete("foo") == { "fizz" => "buzz" }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe Msf::DataStore do
|
||||
|
|
Loading…
Reference in New Issue