Sfoglia il codice sorgente

feat(apt): Add the terraform repository

Signed-off-by: Jeremy MAURO <jeremy.mauro@gmail.com>
Jeremy MAURO 2 anni fa
parent
commit
6712b89d73

+ 2 - 0
cookbooks/apt_repositories/spec/spec_helper.rb

@@ -0,0 +1,2 @@
+require 'chefspec'
+require 'chefspec/berkshelf'

+ 29 - 0
cookbooks/apt_repositories/spec/unit/recipes/_terraform_spec.rb

@@ -0,0 +1,29 @@
+#
+# Cookbook:: apt_repositories
+# Spec:: _terraform
+#
+# Copyright:: 2022, The Authors, All Rights Reserved.
+
+require 'spec_helper'
+
+describe 'apt_repositories::_terraform' do
+  context 'When all attributes are default, on Ubuntu 20.04' do
+    # for a complete list of available platforms and versions see:
+    # https://github.com/chefspec/fauxhai/blob/main/PLATFORMS.md
+    platform 'ubuntu', '20.04'
+
+    it 'converges successfully' do
+      expect { chef_run }.to_not raise_error
+    end
+  end
+
+  context 'When all attributes are default, on CentOS 8' do
+    # for a complete list of available platforms and versions see:
+    # https://github.com/chefspec/fauxhai/blob/main/PLATFORMS.md
+    platform 'centos', '8'
+
+    it 'converges successfully' do
+      expect { chef_run }.to_not raise_error
+    end
+  end
+end

+ 16 - 0
cookbooks/apt_repositories/test/integration/default/_terraform_test.rb

@@ -0,0 +1,16 @@
+# Chef InSpec test for recipe apt_repositories::_terraform
+
+# The Chef InSpec reference, with examples and extensive documentation, can be
+# found at https://docs.chef.io/inspec/resources/
+
+unless os.windows?
+  # This is an example test, replace with your own test.
+  describe user('root'), :skip do
+    it { should exist }
+  end
+end
+
+# This is an example test, replace it with your own test.
+describe port(80), :skip do
+  it { should_not be_listening }
+end