Skip to content

Commit 757871e

Browse files
committed
Make raise and rb_raise messages consistent
1 parent 3532678 commit 757871e

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

ext/vernier/vernier.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1989,7 +1989,7 @@ collector_start(VALUE self) {
19891989
auto *collector = get_collector(self);
19901990

19911991
if (!collector->start()) {
1992-
rb_raise(rb_eRuntimeError, "already running");
1992+
rb_raise(rb_eRuntimeError, "collector already running");
19931993
}
19941994

19951995
return Qtrue;

lib/vernier.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ def self.start_profile(mode: :wall, **collector_options)
4040
@collector.stop
4141
@collector = nil
4242

43-
raise "Profile already started, stopping..."
43+
raise "profile already started, stopping..."
4444
end
4545

4646
@collector = Vernier::Collector.new(mode, collector_options)
4747
@collector.start
4848
end
4949

5050
def self.stop_profile
51-
raise "No profile started" unless @collector
51+
raise "profile not started" unless @collector
5252

5353
result = @collector.stop
5454
@collector = nil

lib/vernier/collector.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def initialize(mode, options = {})
3232
when :rails, :activesupport
3333
@hooks << Vernier::Hooks::ActiveSupport.new(self)
3434
else
35-
warn "Unknown hook: #{hook.inspect}"
35+
warn "unknown hook: #{hook.inspect}"
3636
end
3737
end
3838

test/test_time_collector.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,14 +247,14 @@ def test_multiple_starts
247247
Vernier.start_profile(interval: SAMPLE_SCALE_INTERVAL)
248248
Vernier.start_profile(interval: SAMPLE_SCALE_INTERVAL)
249249
end
250-
assert_equal "Profile already started, stopping...", error.message
250+
assert_equal "profile already started, stopping...", error.message
251251
end
252252

253253
def test_stop_without_start
254254
error = assert_raises("No trace started") do
255255
Vernier.stop_profile
256256
end
257-
assert_equal "No profile started", error.message
257+
assert_equal "profile not started", error.message
258258
end
259259

260260
def test_includes_options_in_result_meta

0 commit comments

Comments
 (0)