From ef8cc2ab41340001e422324998bd5418641edbe1 Mon Sep 17 00:00:00 2001 From: Anthony Riley II Date: Fri, 8 Dec 2023 10:41:32 -0800 Subject: [PATCH] adding many more syntax fixes --- bin/octofacts-updater | 2 +- lib/octofacts.rb | 2 +- lib/octofacts/backends/base.rb | 2 +- lib/octofacts/backends/index.rb | 2 +- lib/octofacts/backends/yaml_file.rb | 2 +- lib/octofacts/constructors/from_index.rb | 1 + lib/octofacts/manipulators/base.rb | 2 +- lib/octofacts_updater/service/enc.rb | 1 + lib/octofacts_updater/service/local_file.rb | 1 + lib/octofacts_updater/service/puppetdb.rb | 1 + lib/octofacts_updater/service/ssh.rb | 1 + lib/octofacts_updater/version.rb | 1 + octofacts-updater.gemspec | 1 + octofacts.gemspec | 1 + rake/gem.rb | 2 +- script/console | 1 + .../modules/test/spec/classes/test_one_spec.rb | 3 ++- spec/integration/spec/spec_helper.rb | 1 + spec/octofacts/backends/index_spec.rb | 1 + spec/octofacts/backends/yaml_file_spec.rb | 1 + spec/octofacts/constructors/from_file_spec.rb | 1 + spec/octofacts/examples_spec.rb | 1 + spec/octofacts/facts_spec.rb | 1 + spec/octofacts/manipulators/base_spec.rb | 1 + spec/octofacts/manipulators/replace_spec.rb | 1 + spec/octofacts/manipulators_spec.rb | 1 + spec/octofacts/octofacts_spec.rb | 2 ++ spec/octofacts/octofacts_spec_helper.rb | 1 + spec/octofacts/util/config_spec.rb | 1 + spec/octofacts/util/keys_spec.rb | 5 +++-- spec/octofacts_updater/fact_index_spec.rb | 1 + spec/octofacts_updater/fact_spec.rb | 1 + spec/octofacts_updater/fixture_spec.rb | 7 ++++--- spec/octofacts_updater/octofacts_updater_spec.rb | 1 + spec/octofacts_updater/plugin_spec.rb | 1 + spec/octofacts_updater/plugins/ip_spec.rb | 1 + spec/octofacts_updater/plugins/ssh_spec.rb | 3 ++- spec/octofacts_updater/plugins/static_spec.rb | 3 ++- spec/octofacts_updater/service/github_spec.rb | 1 + spec/octofacts_updater/service/local_file_spec.rb | 9 +++++---- spec/octofacts_updater/service/ssh_spec.rb | 11 ++++++----- spec/spec_helper.rb | 1 + 42 files changed, 60 insertions(+), 24 deletions(-) diff --git a/bin/octofacts-updater b/bin/octofacts-updater index da27f1e..fabebb4 100755 --- a/bin/octofacts-updater +++ b/bin/octofacts-updater @@ -1,5 +1,5 @@ #!/usr/bin/env ruby -# frozen_literal_string: true +# frozen_string_literal: true # require "bundler/setup" require "octofacts_updater" diff --git a/lib/octofacts.rb b/lib/octofacts.rb index f7260a3..49bf4ee 100644 --- a/lib/octofacts.rb +++ b/lib/octofacts.rb @@ -1,4 +1,4 @@ -# frozen_literal_string: true +# frozen_string_literal: true require "octofacts/constructors/from_file" require "octofacts/constructors/from_index" require "octofacts/manipulators" diff --git a/lib/octofacts/backends/base.rb b/lib/octofacts/backends/base.rb index 155a77a..fcd6f19 100644 --- a/lib/octofacts/backends/base.rb +++ b/lib/octofacts/backends/base.rb @@ -1,4 +1,4 @@ -# frozen_literal_string: true +# frozen_string_literal: true module Octofacts module Backends # This is a template class to define the minimum API to be implemented diff --git a/lib/octofacts/backends/index.rb b/lib/octofacts/backends/index.rb index 74cd473..2ae9d2e 100644 --- a/lib/octofacts/backends/index.rb +++ b/lib/octofacts/backends/index.rb @@ -1,4 +1,4 @@ -# frozen_literal_string: true +# frozen_string_literal: true require "yaml" require "set" diff --git a/lib/octofacts/backends/yaml_file.rb b/lib/octofacts/backends/yaml_file.rb index c5dd190..51e04f4 100644 --- a/lib/octofacts/backends/yaml_file.rb +++ b/lib/octofacts/backends/yaml_file.rb @@ -1,4 +1,4 @@ -# frozen_literal_string: true +# frozen_string_literal: true # require "yaml" diff --git a/lib/octofacts/constructors/from_index.rb b/lib/octofacts/constructors/from_index.rb index 89c483c..babb8a4 100644 --- a/lib/octofacts/constructors/from_index.rb +++ b/lib/octofacts/constructors/from_index.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Octofacts # Octofacts.from_index(options) - Construct Octofacts::Facts from an index file. # diff --git a/lib/octofacts/manipulators/base.rb b/lib/octofacts/manipulators/base.rb index 12192c7..3641fa5 100644 --- a/lib/octofacts/manipulators/base.rb +++ b/lib/octofacts/manipulators/base.rb @@ -1,4 +1,4 @@ -# # frozen_string_literal: true +# frozen_string_literal: true module Octofacts class Manipulators # Delete a fact from a hash. diff --git a/lib/octofacts_updater/service/enc.rb b/lib/octofacts_updater/service/enc.rb index a2225da..1d72a7a 100644 --- a/lib/octofacts_updater/service/enc.rb +++ b/lib/octofacts_updater/service/enc.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # This class contains methods to interact with an external node classifier. require "open3" diff --git a/lib/octofacts_updater/service/local_file.rb b/lib/octofacts_updater/service/local_file.rb index b1095fd..b03be6f 100644 --- a/lib/octofacts_updater/service/local_file.rb +++ b/lib/octofacts_updater/service/local_file.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # This class reads a YAML file from the local file system so that it can be used as a source # in octofacts-updater. This was originally intended for a quickstart tutorial, since it requires # no real configuration. However it could also be used in production, if the user wants to create diff --git a/lib/octofacts_updater/service/puppetdb.rb b/lib/octofacts_updater/service/puppetdb.rb index ac6dd26..06850e5 100644 --- a/lib/octofacts_updater/service/puppetdb.rb +++ b/lib/octofacts_updater/service/puppetdb.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # This class interacts with puppetdb to pull the facts from the recent # run of Puppet on a given node. This uses octocatalog-diff on the back end to # pull the facts from puppetdb. diff --git a/lib/octofacts_updater/service/ssh.rb b/lib/octofacts_updater/service/ssh.rb index 361bbb2..8ba5c21 100644 --- a/lib/octofacts_updater/service/ssh.rb +++ b/lib/octofacts_updater/service/ssh.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # This class interacts with a puppetserver to obtain facts from that server's YAML cache. # This is achieved by SSH-ing to the server and obtaining the fact file directly from the # puppetserver's cache. This can also be used to SSH to an actual node and run a command, diff --git a/lib/octofacts_updater/version.rb b/lib/octofacts_updater/version.rb index 1adaec3..5eb8425 100644 --- a/lib/octofacts_updater/version.rb +++ b/lib/octofacts_updater/version.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module OctofactsUpdater VERSION = File.read(File.expand_path("../../.version", File.dirname(__FILE__))).strip end diff --git a/octofacts-updater.gemspec b/octofacts-updater.gemspec index 9704c08..7f1f5aa 100644 --- a/octofacts-updater.gemspec +++ b/octofacts-updater.gemspec @@ -1,3 +1,4 @@ +# frozen_string_literal: true # coding: utf-8 Gem::Specification.new do |spec| diff --git a/octofacts.gemspec b/octofacts.gemspec index 8ad8456..08df953 100644 --- a/octofacts.gemspec +++ b/octofacts.gemspec @@ -1,3 +1,4 @@ +# frozen_string_literal: true # coding: utf-8 Gem::Specification.new do |spec| diff --git a/rake/gem.rb b/rake/gem.rb index 0159cea..6634858 100644 --- a/rake/gem.rb +++ b/rake/gem.rb @@ -5,7 +5,7 @@ ## 3. Commit changes, PR, and merge to master ## 4. Check out master branch locally ## 5. Run `bundle exec rake gem:release` - +# frozen_string_literal: true require "fileutils" require "open3" require "shellwords" diff --git a/script/console b/script/console index ebd0a12..05aa35f 100755 --- a/script/console +++ b/script/console @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true require "bundler/setup" require "octofacts" diff --git a/spec/integration/modules/test/spec/classes/test_one_spec.rb b/spec/integration/modules/test/spec/classes/test_one_spec.rb index 739f077..164805c 100644 --- a/spec/integration/modules/test/spec/classes/test_one_spec.rb +++ b/spec/integration/modules/test/spec/classes/test_one_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require_relative "../../../../spec/spec_helper" describe "test::one" do @@ -7,7 +8,7 @@ describe "test::one" do let(:facts) do { ec2: true, - ec2_metadata: { placement: { :"availability-zone" => "us-foo-1a" } }, + ec2_metadata: { placement: { :"availability-zone" : "us-foo-1a" } }, gid: "root", id: "root" } diff --git a/spec/integration/spec/spec_helper.rb b/spec/integration/spec/spec_helper.rb index 2eb0206..aec23dd 100644 --- a/spec/integration/spec/spec_helper.rb +++ b/spec/integration/spec/spec_helper.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # spec_helper for rspec-puppet fixture require_relative "../../../lib/octofacts" diff --git a/spec/octofacts/backends/index_spec.rb b/spec/octofacts/backends/index_spec.rb index 4e8c9ab..4ab50e0 100644 --- a/spec/octofacts/backends/index_spec.rb +++ b/spec/octofacts/backends/index_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe Octofacts::Backends::Index do diff --git a/spec/octofacts/backends/yaml_file_spec.rb b/spec/octofacts/backends/yaml_file_spec.rb index e41439b..364a1ae 100644 --- a/spec/octofacts/backends/yaml_file_spec.rb +++ b/spec/octofacts/backends/yaml_file_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe Octofacts::Backends::YamlFile do diff --git a/spec/octofacts/constructors/from_file_spec.rb b/spec/octofacts/constructors/from_file_spec.rb index 0b7e7fe..49b0b8d 100644 --- a/spec/octofacts/constructors/from_file_spec.rb +++ b/spec/octofacts/constructors/from_file_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe Octofacts do diff --git a/spec/octofacts/examples_spec.rb b/spec/octofacts/examples_spec.rb index c7336c6..019948b 100644 --- a/spec/octofacts/examples_spec.rb +++ b/spec/octofacts/examples_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Make sure the examples in the README document actually work. :-) require "spec_helper" diff --git a/spec/octofacts/facts_spec.rb b/spec/octofacts/facts_spec.rb index 051039b..20bfd37 100644 --- a/spec/octofacts/facts_spec.rb +++ b/spec/octofacts/facts_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe Octofacts::Facts do diff --git a/spec/octofacts/manipulators/base_spec.rb b/spec/octofacts/manipulators/base_spec.rb index 0d793fc..f4b12b3 100644 --- a/spec/octofacts/manipulators/base_spec.rb +++ b/spec/octofacts/manipulators/base_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe Octofacts::Manipulators do diff --git a/spec/octofacts/manipulators/replace_spec.rb b/spec/octofacts/manipulators/replace_spec.rb index fc97cbd..6c566f4 100644 --- a/spec/octofacts/manipulators/replace_spec.rb +++ b/spec/octofacts/manipulators/replace_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" require "yaml" diff --git a/spec/octofacts/manipulators_spec.rb b/spec/octofacts/manipulators_spec.rb index 7a2c201..63c14b5 100644 --- a/spec/octofacts/manipulators_spec.rb +++ b/spec/octofacts/manipulators_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe Octofacts::Manipulators do diff --git a/spec/octofacts/octofacts_spec.rb b/spec/octofacts/octofacts_spec.rb index c1f1976..b67916c 100644 --- a/spec/octofacts/octofacts_spec.rb +++ b/spec/octofacts/octofacts_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true +# require "spec_helper" # FIXME: Remove when real specs are added diff --git a/spec/octofacts/octofacts_spec_helper.rb b/spec/octofacts/octofacts_spec_helper.rb index 00aa858..eb876ef 100644 --- a/spec/octofacts/octofacts_spec_helper.rb +++ b/spec/octofacts/octofacts_spec_helper.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Octofacts class Spec def self.fixture_root diff --git a/spec/octofacts/util/config_spec.rb b/spec/octofacts/util/config_spec.rb index 32258c4..3431051 100644 --- a/spec/octofacts/util/config_spec.rb +++ b/spec/octofacts/util/config_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe Octofacts::Util::Config do diff --git a/spec/octofacts/util/keys_spec.rb b/spec/octofacts/util/keys_spec.rb index 81083d8..8a38140 100644 --- a/spec/octofacts/util/keys_spec.rb +++ b/spec/octofacts/util/keys_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true describe Octofacts::Util::Keys do describe "#downcase_keys!" do let(:facts) do @@ -7,8 +8,8 @@ describe Octofacts::Util::Keys do it "should work" do f = facts result = described_class.downcase_keys!(f) - expect(f).to eq({"foo" => "foo-value", baz: "baz-value", "bar" => "bar-value", buzz: "buzz-value"}) - expect(result).to eq({"foo" => "foo-value", baz: "baz-value", "bar" => "bar-value", buzz: "buzz-value"}) + expect(f).to eq({"foo": "foo-value", baz: "baz-value", "bar": "bar-value", buzz: "buzz-value"}) + expect(result).to eq({"foo": "foo-value", baz: "baz-value", "bar": "bar-value", buzz: "buzz-value"}) end end diff --git a/spec/octofacts_updater/fact_index_spec.rb b/spec/octofacts_updater/fact_index_spec.rb index 592e690..527bf16 100644 --- a/spec/octofacts_updater/fact_index_spec.rb +++ b/spec/octofacts_updater/fact_index_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe OctofactsUpdater::FactIndex do diff --git a/spec/octofacts_updater/fact_spec.rb b/spec/octofacts_updater/fact_spec.rb index a38bd99..5d846ef 100644 --- a/spec/octofacts_updater/fact_spec.rb +++ b/spec/octofacts_updater/fact_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe OctofactsUpdater::Fact do diff --git a/spec/octofacts_updater/fixture_spec.rb b/spec/octofacts_updater/fixture_spec.rb index 6f6ffc8..0731eea 100644 --- a/spec/octofacts_updater/fixture_spec.rb +++ b/spec/octofacts_updater/fixture_spec.rb @@ -1,11 +1,12 @@ +# frozen_string_literal: true require "spec_helper" describe OctofactsUpdater::Fixture do describe "#make" do let(:hostname) { "HostName" } - let(:config) {{ "enc" => { "path" => "/foo" }, "puppetdb" => { "url" => "https://puppetdb.example.com:8081" } }} - let(:enc_return) {{ "parameters" => { "fizz" => "buzz" }, "classes" => ["class1", "class2"] }} - let(:fact_hash_with_values) {{ "name" => hostname, "values" => { "foo" => "bar" } }} + let(:config) { { "enc" => { "path" => "/foo" }, "puppetdb" => { "url" => "https://puppetdb.example.com:8081" } } } + let(:enc_return) { { "parameters" => { "fizz" => "buzz" }, "classes" => ["class1", "class2"] } } + let(:fact_hash_with_values) { { "name" => hostname, "values" => { "foo" => "bar" } } } it "should instantiate and return a fixture object with the given facts" do expect(OctofactsUpdater::Service::ENC).to receive(:run_enc).with(hostname, config).and_return(enc_return) diff --git a/spec/octofacts_updater/octofacts_updater_spec.rb b/spec/octofacts_updater/octofacts_updater_spec.rb index 521f26d..a803358 100644 --- a/spec/octofacts_updater/octofacts_updater_spec.rb +++ b/spec/octofacts_updater/octofacts_updater_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe OctofactsUpdater::VERSION do diff --git a/spec/octofacts_updater/plugin_spec.rb b/spec/octofacts_updater/plugin_spec.rb index cd4b935..c823383 100644 --- a/spec/octofacts_updater/plugin_spec.rb +++ b/spec/octofacts_updater/plugin_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe OctofactsUpdater::Plugin do diff --git a/spec/octofacts_updater/plugins/ip_spec.rb b/spec/octofacts_updater/plugins/ip_spec.rb index 50463ae..14f46b3 100644 --- a/spec/octofacts_updater/plugins/ip_spec.rb +++ b/spec/octofacts_updater/plugins/ip_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" require "ipaddr" diff --git a/spec/octofacts_updater/plugins/ssh_spec.rb b/spec/octofacts_updater/plugins/ssh_spec.rb index eaedf6a..7b5775f 100644 --- a/spec/octofacts_updater/plugins/ssh_spec.rb +++ b/spec/octofacts_updater/plugins/ssh_spec.rb @@ -1,9 +1,10 @@ +# frozen_string_literal: true require "spec_helper" describe "sshfp_randomize plugin" do let(:plugin) { OctofactsUpdater::Plugin.plugins[:sshfp_randomize] } let(:value) { "SSHFP 1 1 0123456789abcdef0123456789abcdef01234567\nSSHFP 1 2 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" } - let(:args) {{ "plugin" => "sshfp_randomize" }} + let(:args) { { "plugin" => "sshfp_randomize" } } it "should be defined" do expect(plugin).to be_a_kind_of(Proc) diff --git a/spec/octofacts_updater/plugins/static_spec.rb b/spec/octofacts_updater/plugins/static_spec.rb index c45077e..5f203c1 100644 --- a/spec/octofacts_updater/plugins/static_spec.rb +++ b/spec/octofacts_updater/plugins/static_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "delete plugin" do @@ -112,7 +113,7 @@ end describe "randomize_long_string plugin" do let(:plugin) { OctofactsUpdater::Plugin.plugins[:randomize_long_string] } let(:value) { "1234567890abcdef" } - let(:args) {{ "plugin" => "randomize_long_string" }} + let(:args) { { "plugin" => "randomize_long_string" } } it "should be defined" do expect(plugin).to be_a_kind_of(Proc) diff --git a/spec/octofacts_updater/service/github_spec.rb b/spec/octofacts_updater/service/github_spec.rb index 81022e1..5fe2d67 100644 --- a/spec/octofacts_updater/service/github_spec.rb +++ b/spec/octofacts_updater/service/github_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" require "ostruct" diff --git a/spec/octofacts_updater/service/local_file_spec.rb b/spec/octofacts_updater/service/local_file_spec.rb index 804ca80..f6bf016 100644 --- a/spec/octofacts_updater/service/local_file_spec.rb +++ b/spec/octofacts_updater/service/local_file_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe OctofactsUpdater::Service::LocalFile do @@ -8,12 +9,12 @@ describe OctofactsUpdater::Service::LocalFile do context "when localfile is not configured" do it "should raise ArgumentError when localfile is undefined" do config = {} - expect{ described_class.facts(node, config) }.to raise_error(ArgumentError, /requires localfile section/) + expect { described_class.facts(node, config) }.to raise_error(ArgumentError, /requires localfile section/) end it "should raise ArgumentError when localfile is not a hash" do config = {"localfile" => :do_it} - expect{ described_class.facts(node, config) }.to raise_error(ArgumentError, /requires localfile section/) + expect { described_class.facts(node, config) }.to raise_error(ArgumentError, /requires localfile section/) end end @@ -22,12 +23,12 @@ describe OctofactsUpdater::Service::LocalFile do it "should raise error if the path is undefined" do config = { "localfile" => {} } - expect{ described_class.facts(node, config) }.to raise_error(ArgumentError, /requires 'path' in the localfile section/) + expect { described_class.facts(node, config) }.to raise_error(ArgumentError, /requires 'path' in the localfile section/) end it "should raise error if the path does not exist" do config = { "localfile" => { "path" => File.join(file_path, "missing.yaml") } } - expect{ described_class.facts(node, config) }.to raise_error(Errno::ENOENT, /LocalFile cannot find a file at/) + expect { described_class.facts(node, config) }.to raise_error(Errno::ENOENT, /LocalFile cannot find a file at/) end it "should return the proper object from the parsed file" do diff --git a/spec/octofacts_updater/service/ssh_spec.rb b/spec/octofacts_updater/service/ssh_spec.rb index 3f55d88..0a3026e 100644 --- a/spec/octofacts_updater/service/ssh_spec.rb +++ b/spec/octofacts_updater/service/ssh_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe OctofactsUpdater::Service::SSH do @@ -8,19 +9,19 @@ describe OctofactsUpdater::Service::SSH do context "when ssh is not configured" do it "should raise ArgumentError when ssh is undefined" do config = {} - expect{ described_class.facts(node, config) }.to raise_error(ArgumentError, /requires ssh section/) + expect { described_class.facts(node, config) }.to raise_error(ArgumentError, /requires ssh section/) end it "should raise ArgumentError when ssh is not a hash" do config = {"ssh" => :do_it} - expect{ described_class.facts(node, config) }.to raise_error(ArgumentError, /requires ssh section/) + expect { described_class.facts(node, config) }.to raise_error(ArgumentError, /requires ssh section/) end end context "when ssh is configured" do it "should raise error if no server is configured" do config = { "ssh" => {} } - expect{ described_class.facts(node, config) }.to raise_error(ArgumentError, /requires 'server' in the ssh section/) + expect { described_class.facts(node, config) }.to raise_error(ArgumentError, /requires 'server' in the ssh section/) end context "when user is unspecified" do @@ -38,14 +39,14 @@ describe OctofactsUpdater::Service::SSH do it "should raise error if no user is configured" do config = { "ssh" => { "server" => "puppetserver.example.net" } } - expect{ described_class.facts(node, config) }.to raise_error(ArgumentError, /requires 'user' in the ssh section/) + expect { described_class.facts(node, config) }.to raise_error(ArgumentError, /requires 'user' in the ssh section/) end it "should use USER from environment if no user is configured" do ENV["USER"] = "ssh-user-from-env" config = { "ssh" => { "server" => "puppetserver.example.net" } } expect(Net::SSH).to receive(:start).with("puppetserver.example.net", "ssh-user-from-env", {}).and_raise(custom_exception) - expect{ described_class.facts(node, config) }.to raise_error(custom_exception) + expect { described_class.facts(node, config) }.to raise_error(custom_exception) end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 5be8d5b..b2839ec 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true if ENV["SPEC_NAME"] require "simplecov" require "simplecov-json"