lib/undercover/options.rb in undercover-0.1.2 vs lib/undercover/options.rb in undercover-0.1.3

- old
+ new

@@ -23,11 +23,10 @@ # TODO: use run modes # TODO: use formatters @run_mode = RUN_MODE_DIFF_STRICT @enabled_formatters = [OUTPUT_STDOUT] # set defaults - self.lcov = guess_lcov_path self.path = '.' self.git_dir = '.git' end # rubocop:disable Metrics/MethodLength @@ -52,10 +51,11 @@ # TODO: parse dem other options and assign to self # --quiet (skip progress bar) # --exit-status (do not print report, just exit) # --ruby-version (string, like '2.4.4', how to support in parser?) end.parse(args) + guess_lcov_path unless lcov self end # rubocop:enable Metrics/MethodLength private @@ -85,10 +85,10 @@ self.compare = ref end end def guess_lcov_path - pwd = Pathname.pwd - File.join(pwd, 'coverage', 'lcov', "#{pwd.split.last}.lcov") + cwd = Pathname.new(File.expand_path(path)) + self.lcov = File.join(cwd, 'coverage', 'lcov', "#{cwd.split.last}.lcov") end end end