Skip to content

Commit 5ef5292

Browse files
author
Kevin Paulisse
committed
Fix up code coverage
1 parent 1d55f56 commit 5ef5292

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

lib/octocatalog-diff/catalog/computed.rb

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -165,22 +165,20 @@ def puppet_command
165165
end
166166

167167
def puppet_command_obj
168-
return @puppet_command_obj if @puppet_command_obj
169-
170-
unless @puppet_binary
171-
raise ArgumentError, '"puppet_binary" was not passed to OctocatalogDiff::Catalog::Computed'
168+
@puppet_command_obj ||= begin
169+
raise ArgumentError, '"puppet_binary" was not passed to OctocatalogDiff::Catalog::Computed' unless @puppet_binary
170+
171+
command_opts = @opts.merge(
172+
node: @node,
173+
compilation_dir: @builddir.tempdir,
174+
parser: @opts.fetch(:parser, :default),
175+
puppet_binary: @puppet_binary,
176+
fact_file: @builddir.fact_file,
177+
dir: @builddir.tempdir,
178+
enc: @builddir.enc
179+
)
180+
OctocatalogDiff::CatalogUtil::Command.new(command_opts)
172181
end
173-
174-
command_opts = @opts.merge(
175-
node: @node,
176-
compilation_dir: @builddir.tempdir,
177-
parser: @opts.fetch(:parser, :default),
178-
puppet_binary: @puppet_binary,
179-
fact_file: @builddir.fact_file,
180-
dir: @builddir.tempdir,
181-
enc: @builddir.enc
182-
)
183-
@puppet_command_obj = OctocatalogDiff::CatalogUtil::Command.new(command_opts)
184182
end
185183

186184
# Private method: Actually execute puppet

lib/octocatalog-diff/util/puppetversion.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ def self.puppet_version(puppet, options = {})
3737

3838
output = script.run(sr_run_opts)
3939
return Regexp.last_match(1) if output =~ /^([\d\.]+)\s*$/
40+
# :nocov:
4041
raise "Unable to determine Puppet version: #{script.output}"
42+
# :nocov:
4143
end
4244
end
4345
end

0 commit comments

Comments
 (0)