diff --git a/lib/msf/core/data_store.rb b/lib/msf/core/data_store.rb index 5ffbf81bce..f234e486f7 100644 --- a/lib/msf/core/data_store.rb +++ b/lib/msf/core/data_store.rb @@ -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 diff --git a/spec/lib/msf/core/data_store_spec.rb b/spec/lib/msf/core/data_store_spec.rb index e55d3154ee..97421714ca 100644 --- a/spec/lib/msf/core/data_store_spec.rb +++ b/spec/lib/msf/core/data_store_spec.rb @@ -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