Skip to content

Commit bd01ce6

Browse files
committed
Remove unnecesary acceptance tests
1 parent ce7640b commit bd01ce6

File tree

5 files changed

+5
-95
lines changed

5 files changed

+5
-95
lines changed

.rubocop_todo.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2025-10-29 07:31:19 UTC using RuboCop version 1.73.2.
3+
# on 2025-11-04 11:21:01 UTC using RuboCop version 1.73.2.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
77
# versions of RuboCop, may require this file to be generated again.
88

9-
# Offense count: 3
9+
# Offense count: 2
1010
# This cop supports safe autocorrection (--autocorrect).
1111
RSpec/ExpectActual:
1212
Exclude:
1313
- '**/spec/routing/**/*'
14-
- 'spec/acceptance/deferred_spec.rb'
14+
- 'spec/acceptance/basic_functionality/deferred_spec.rb'
1515

1616
# Offense count: 2
1717
# Configuration parameters: Include, CustomTransform, IgnoreMethods, IgnoreMetadata.

spec/acceptance/deferred_spec.rb renamed to spec/acceptance/basic_functionality/deferred_spec.rb

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
require 'spec_helper_acceptance'
55

66
def read_fixture(name)
7-
File.read(File.join(__dir__, '..', 'fixtures', 'manifests', name))
7+
File.read(File.join(__dir__, '..', '..', 'fixtures', 'manifests', name))
88
end
99

1010
def read_win_file_if_exists(path)
@@ -21,10 +21,7 @@ def read_win_file_if_exists(path)
2121
let(:control_manifest) { read_fixture('01_file_deferred.pp') }
2222
let(:dsc_control_manifest_epp) { read_fixture('01b_file_deferred_with_epp.pp') }
2323
let(:dsc_deferred_direct) { read_fixture('02_dsc_deferred_direct.pp') }
24-
let(:dsc_deferred_inline) { read_fixture('02b_dsc_deferred_inline.pp') } # ← NEW
25-
let(:dsc_deferred_epp_inline) { read_fixture('02c_dsc_deferred_inline_epp.pp') } # ← NEW
26-
let(:dsc_deferred_stringified) { read_fixture('03a_dsc_deferred_stringified.pp') }
27-
let(:dsc_deferred_bad_unwrap) { read_fixture('03b_dsc_deferred_bad_unwrap.pp') }
24+
let(:dsc_deferred_inline) { read_fixture('02b_dsc_deferred_inline.pp') }
2825

2926
it 'control (01): native file + Deferred resolves to hello-file' do
3027
result = idempotent_apply(control_manifest)
@@ -68,35 +65,4 @@ def read_win_file_if_exists(path)
6865
raise "Unexpected 02b outcome. Exists=#{out[:exists]} Content=#{content.inspect}\nApply:\n#{apply.stdout}#{apply.stderr}"
6966
end
7067
end
71-
72-
# NEW 02c: inline Deferred on the DSC property (no variable intermediary)
73-
it '02c: passing a Deferred inline while calling an epp' do
74-
apply = apply_manifest(dsc_deferred_epp_inline)
75-
out = read_win_file_if_exists('C:/Temp/from_dsc.txt')
76-
content = out[:content].strip
77-
if out[:exists] && content == 'hello-dsc-epp'
78-
expect(true).to be(true)
79-
elsif out[:exists] && content =~ %r{Deferred\s*\(|Puppet::Pops::Types::Deferred}i
80-
raise "BUG: 02c wrote stringified Deferred: #{content.inspect}\nApply:\n#{apply.stdout}#{apply.stderr}"
81-
else
82-
raise "Unexpected 02c outcome. Exists=#{out[:exists]} Content=#{content.inspect}\nApply:\n#{apply.stdout}#{apply.stderr}"
83-
end
84-
end
85-
86-
it '03a: stringifying a Deferred writes the function form (reproduces customer report)' do
87-
apply_manifest(dsc_deferred_stringified)
88-
out = read_win_file_if_exists('C:/Temp/from_dsc_var_string.txt')
89-
expect(out[:exists]).to be(true)
90-
expect(out[:content]).to match(%r{Deferred\s*\(|Puppet::Pops::Types::Deferred}i)
91-
expect(out[:content]).not_to match(%r{\bhello-var\b})
92-
end
93-
94-
it '03b: unwrap on a non‑Sensitive is a no‑op; also writes the function form' do
95-
apply_manifest(dsc_deferred_bad_unwrap)
96-
out = read_win_file_if_exists('C:/Temp/from_dsc_var_bad_unwrap.txt')
97-
out = read_win_file_if_exists('C:/Temp/from_dsc_var.txt') unless out[:exists]
98-
expect(out[:exists]).to be(true)
99-
expect(out[:content]).to match(%r{Deferred\s*\(|Puppet::Pops::Types::Deferred}i)
100-
expect(out[:content]).not_to match(%r{\bhello-var\b})
101-
end
10268
end

spec/fixtures/manifests/02c_dsc_deferred_inline_epp.pp

Lines changed: 0 additions & 18 deletions
This file was deleted.

spec/fixtures/manifests/03a_dsc_deferred_stringified.pp

Lines changed: 0 additions & 19 deletions
This file was deleted.

spec/fixtures/manifests/03b_dsc_deferred_bad_unwrap.pp

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)