spec/unit/application_spec.rb in ohai-8.10.0 vs spec/unit/application_spec.rb in ohai-8.11.1
- old
+ new
@@ -14,15 +14,15 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
-require_relative '../spec_helper'
+require_relative "../spec_helper"
-require 'ohai/application'
+require "ohai/application"
-RSpec.describe 'Ohai::Application' do
+RSpec.describe "Ohai::Application" do
let(:argv) { [] }
let(:app) { Ohai::Application.new }
before(:each) do
@@ -33,16 +33,16 @@
after(:each) do
ARGV.replace(@original_argv)
end
describe '#configure_ohai' do
- describe 'loading configuration from a file' do
- let(:config_file) { '/local/workstation/config' }
- let(:config_loader) { instance_double('ChefConfig::WorkstationConfigLoader') }
+ describe "loading configuration from a file" do
+ let(:config_file) { "/local/workstation/config" }
+ let(:config_loader) { instance_double("ChefConfig::WorkstationConfigLoader") }
- context 'when specified on the command line' do
- let(:argv) { [ '-c', config_file ] }
+ context "when specified on the command line" do
+ let(:argv) { [ "-c", config_file ] }
before(:each) do
if windows?
expect(ChefConfig::WorkstationConfigLoader).to receive(:new).
with("C:#{config_file}", Ohai::Log).
@@ -52,42 +52,42 @@
with(config_file, Ohai::Log).
and_return(config_loader)
end
end
- it 'loads the configuration file' do
+ it "loads the configuration file" do
expect(config_loader).to receive(:load)
app.configure_ohai
end
- context 'when the configuration file does not exist' do
- it 'terminates the application' do
+ context "when the configuration file does not exist" do
+ it "terminates the application" do
expect(config_loader).to receive(:load).and_raise(ChefConfig::ConfigurationError)
expect(Ohai::Application).to receive(:fatal!)
app.configure_ohai
end
end
end
- context 'when a local workstation config exists' do
+ context "when a local workstation config exists" do
before(:each) do
expect(ChefConfig::WorkstationConfigLoader).to receive(:new).
with(nil, Ohai::Log).
and_return(config_loader)
end
- it 'loads the configuration file' do
+ it "loads the configuration file" do
expect(config_loader).to receive(:load)
app.configure_ohai
end
end
end
- context 'when CLI options are provided' do
- let(:argv) { [ '-d', directory ] }
- let(:directory) { '/some/fantastic/plugins' }
+ context "when CLI options are provided" do
+ let(:argv) { [ "-d", directory ] }
+ let(:directory) { "/some/fantastic/plugins" }
- it 'does not generate deprecated config warnings for cli options' do
+ it "does not generate deprecated config warnings for cli options" do
expect(Ohai::Log).to_not receive(:warn).
with(/Ohai::Config\[:directory\] is deprecated/)
app.configure_ohai
end
end