Skip to content

Commit f8d8890

Browse files
author
Kevin Paulisse
committed
Create preserve environments fixture and part of integration test
1 parent fdbe45d commit f8d8890

7 files changed

Lines changed: 58 additions & 0 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
modulepath = ./modules:$basemodulepath
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class bar {
2+
file { '/tmp/bar':
3+
owner => 'one',
4+
content => $::environment,
5+
}
6+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
modulepath = ./modules:$basemodulepath
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class bar {
2+
file { '/tmp/bar':
3+
owner => 'two',
4+
content => $::environment,
5+
}
6+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node default {
2+
include foo
3+
include bar
4+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class foo {
2+
file { '/tmp/foo':
3+
owner => 'foo',
4+
content => $::environment,
5+
}
6+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# frozen_string_literal: true
2+
3+
require_relative 'integration_helper'
4+
5+
OctocatalogDiff::Spec.require_path('/catalog')
6+
7+
describe 'preserve environments integration' do
8+
context 'without --preserve-environments set' do
9+
before(:all) do
10+
@result = OctocatalogDiff::Integration.integration(
11+
spec_fact_file: 'facts.yaml',
12+
spec_repo: 'preserve-environments',
13+
argv: [
14+
'-n', 'rspec-node.github.net'
15+
]
16+
)
17+
end
18+
19+
it 'should exit with error status' do
20+
expect(@result.exitcode).to eq(-1), OctocatalogDiff::Integration.format_exception(@result)
21+
end
22+
23+
it 'should raise OctocatalogDiff::CatalogDiff::Cli::Catalogs::CatalogError' do
24+
expect(@result.exception).to be_a_kind_of(OctocatalogDiff::CatalogDiff::Cli::Catalogs::CatalogError)
25+
end
26+
27+
it 'should fail because ::bar could not be located' do
28+
expect(@result.exception.message).to match(/Could not find class ::bar for rspec-node.github.net/)
29+
end
30+
end
31+
32+
context 'with --preserve-environments set' do
33+
end
34+
end

0 commit comments

Comments
 (0)