Skip to content

Commit

Permalink
add more specs, try to fix release spec with forcing encoding for git…
Browse files Browse the repository at this point in the history
… ls-files output
  • Loading branch information
anmarchenko committed Mar 15, 2024
1 parent 4b29e46 commit ebee641
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions spec/datadog/ci/cov/cov_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,24 @@ def absolute_path(path)
expect(coverage.keys).to include(absolute_path("calculator/operations/multiply.rb"))
end

it "does not fail if start called several times" do
subject.start
expect(calculator.add(1, 2)).to eq(3)

subject.start
coverage = subject.stop
expect(coverage.size).to eq(1)
end

it "does not fail if stop called several times" do
subject.start
expect(calculator.add(1, 2)).to eq(3)
coverage = subject.stop
expect(coverage.size).to eq(1)

expect(subject.stop).to eq({})
end

it "tracks coverage in mixins" do
subject.start
expect(calculator.divide(6, 3)).to eq(2)
Expand Down
1 change: 1 addition & 0 deletions spec/datadog/ci/release_gem_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
expect(files)
.to match_array(
`git ls-files -z`
.force_encoding(Encoding::UTF_8)
.split("\x0")
.reject { |f| f.match(directories_excluded) }
.reject { |f| f.match(single_files_excluded) }
Expand Down

0 comments on commit ebee641

Please sign in to comment.