From d8625264e9128b5c047e3dad2ab106871dde2479 Mon Sep 17 00:00:00 2001 From: Postmodern Date: Sat, 31 Aug 2024 23:04:47 -0700 Subject: [PATCH] Renamed `Config::Workers#as_yaml` to `#to_h`. --- lib/ronin/recon/config.rb | 4 ++-- spec/config_spec.rb | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/ronin/recon/config.rb b/lib/ronin/recon/config.rb index e8ea23b..8cf9ac5 100644 --- a/lib/ronin/recon/config.rb +++ b/lib/ronin/recon/config.rb @@ -180,7 +180,7 @@ def eql?(other) # # @since 0.2.0 # - def as_yaml + def to_h hash = {} # enable the workers in the set. @@ -405,7 +405,7 @@ def to_yaml(options={}) data[:params] = @params unless @params.empty? data[:concurrency] = @concurrency unless @concurrency.empty? - data[:workers] = @workers.as_yaml if @workers + data[:workers] = @workers.to_h if @workers data.to_yaml(options) end diff --git a/spec/config_spec.rb b/spec/config_spec.rb index 71ed8be..d5e8bed 100644 --- a/spec/config_spec.rb +++ b/spec/config_spec.rb @@ -169,12 +169,12 @@ end end - describe "#as_yaml" do + describe "#to_h" do context "when initialized the default set of workers" do subject { described_class.default } it "must return an empty Hash" do - expect(subject.as_yaml).to eq({}) + expect(subject.to_h).to eq({}) end end @@ -184,7 +184,7 @@ subject { described_class.new(set) } it "must return a Hash with the worker IDs from the default, that are not in the array, disabled and the worker IDs that are not in the default set, but in the array, enabled" do - expect(subject.as_yaml).to eq( + expect(subject.to_h).to eq( { 'dns/mailservers' => false, 'dns/nameservers' => false, @@ -211,7 +211,7 @@ subject { described_class.new(array) } it "must return a Hash with the worker IDs from the default, that are not in the array, disabled and the worker IDs that are not in the default set, but in the array, enabled" do - expect(subject.as_yaml).to eq( + expect(subject.to_h).to eq( { 'dns/mailservers' => false, 'dns/nameservers' => false, @@ -245,7 +245,7 @@ subject { described_class.new(hash) } it "must return a Hash with the worker IDs that are disabled and enabled, which are not already in the default set" do - expect(subject.as_yaml).to eq( + expect(subject.to_h).to eq( { 'net/port_scan' => false, 'web/new_worker' => true