Skip to content

Commit

Permalink
change the exception on invalid coverage mode
Browse files Browse the repository at this point in the history
  • Loading branch information
anmarchenko committed Jun 6, 2024
1 parent 00f9e71 commit 447bc2f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ext/datadog_cov/datadog_cov.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ static VALUE dd_cov_initialize(int argc, VALUE *argv, VALUE self)
}
else
{
rb_raise(rb_eArgError, "mode is invalid");
rb_raise(rb_eArgError, "threading mode is invalid");
}

struct dd_cov_data *dd_cov_data;
Expand Down
10 changes: 10 additions & 0 deletions spec/ddcov/ddcov_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,16 @@ def thread_local_cov
expect(coverage.keys).to include(absolute_path("calculator/operations/multiply.rb"))
end
end

context "when threading mode is invalid" do
let(:threading_mode) { :invalid_mode }

it "raises an error" do
expect { described_class.new(root: root, threading_mode: threading_mode) }.to(
raise_error(ArgumentError, "threading mode is invalid")
)
end
end
end
end
end
Expand Down

0 comments on commit 447bc2f

Please sign in to comment.