Browse Source

Add platform, version to spec files

This patch adds platform and version to the spec files. Without it,
every single test results in this warning:

WARNING: you must specify a 'platform' and 'version' to your ChefSpec Runner and/or Fauxhai constructor, in the future omitting these will become a hard error. A list of available platforms is available at https://github.com/customink/fauxhai/blob/master/PLATFORMS.md
Roger Luethi 1 year ago
parent
commit
15781eac4e
7 changed files with 23 additions and 6 deletions
  1. 3
    1
      spec/domain_spec.rb
  2. 3
    1
      spec/endpoint_spec.rb
  3. 3
    1
      spec/project_spec.rb
  4. 3
    1
      spec/role_spec.rb
  5. 3
    1
      spec/service_spec.rb
  6. 5
    0
      spec/spec_helper.rb
  7. 3
    1
      spec/user_spec.rb

+ 3
- 1
spec/domain_spec.rb View File

@@ -19,7 +19,9 @@ require_relative '../libraries/openstack_domain'
19 19
 
20 20
 describe 'openstackclient_test::domain' do
21 21
   let(:chef_run) do
22
-    runner = ChefSpec::SoloRunner.new(step_into: ['openstack_domain'])
22
+    runner = ChefSpec::SoloRunner.new(
23
+      UBUNTU_OPTS.merge(step_into: ['openstack_domain'])
24
+    )
23 25
     runner.converge(described_recipe)
24 26
   end
25 27
 

+ 3
- 1
spec/endpoint_spec.rb View File

@@ -19,7 +19,9 @@ require_relative '../libraries/openstack_endpoint'
19 19
 
20 20
 describe 'openstackclient_test::endpoint' do
21 21
   let(:chef_run) do
22
-    runner = ChefSpec::SoloRunner.new(step_into: ['openstack_endpoint'])
22
+    runner = ChefSpec::SoloRunner.new(
23
+      UBUNTU_OPTS.merge(step_into: ['openstack_endpoint'])
24
+    )
23 25
     runner.converge(described_recipe)
24 26
   end
25 27
 

+ 3
- 1
spec/project_spec.rb View File

@@ -19,7 +19,9 @@ require_relative '../libraries/openstack_project'
19 19
 
20 20
 describe 'openstackclient_test::project' do
21 21
   let(:chef_run) do
22
-    runner = ChefSpec::SoloRunner.new(step_into: ['openstack_project'])
22
+    runner = ChefSpec::SoloRunner.new(
23
+      UBUNTU_OPTS.merge(step_into: ['openstack_project'])
24
+    )
23 25
     runner.converge(described_recipe)
24 26
   end
25 27
 

+ 3
- 1
spec/role_spec.rb View File

@@ -19,7 +19,9 @@ require_relative '../libraries/openstack_role'
19 19
 
20 20
 describe 'openstackclient_test::role' do
21 21
   let(:chef_run) do
22
-    runner = ChefSpec::SoloRunner.new(step_into: ['openstack_role'])
22
+    runner = ChefSpec::SoloRunner.new(
23
+      UBUNTU_OPTS.merge(step_into: ['openstack_role'])
24
+    )
23 25
     runner.converge(described_recipe)
24 26
   end
25 27
 

+ 3
- 1
spec/service_spec.rb View File

@@ -19,7 +19,9 @@ require_relative '../libraries/openstack_service'
19 19
 
20 20
 describe 'openstackclient_test::service' do
21 21
   let(:chef_run) do
22
-    runner = ChefSpec::SoloRunner.new(step_into: ['openstack_service'])
22
+    runner = ChefSpec::SoloRunner.new(
23
+      UBUNTU_OPTS.merge(step_into: ['openstack_service'])
24
+    )
23 25
     runner.converge(described_recipe)
24 26
   end
25 27
 

+ 5
- 0
spec/spec_helper.rb View File

@@ -23,4 +23,9 @@ RSpec.configure do |config|
23 23
   config.log_level = :error
24 24
 end
25 25
 
26
+UBUNTU_OPTS = {
27
+  platform: 'ubuntu',
28
+  version: '16.04'
29
+}.freeze
30
+
26 31
 at_exit { ChefSpec::Coverage.report! }

+ 3
- 1
spec/user_spec.rb View File

@@ -19,7 +19,9 @@ require_relative '../libraries/openstack_user'
19 19
 
20 20
 describe 'openstackclient_test::user' do
21 21
   let(:chef_run) do
22
-    runner = ChefSpec::SoloRunner.new(step_into: ['openstack_user'])
22
+    runner = ChefSpec::SoloRunner.new(
23
+      UBUNTU_OPTS.merge(step_into: ['openstack_user'])
24
+    )
23 25
     runner.converge(described_recipe)
24 26
   end
25 27
 

Loading…
Cancel
Save