Skip to content

Commit 58132e3

Browse files
committed
Use standard NoMethodError
1 parent 26ef8d2 commit 58132e3

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

spec/truffle/graal/assert_constant_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
describe "TrufflePrimitive.assert_compilation_constant" do
1212

1313
it "raises a RuntimeError when called dynamically" do
14-
-> { tp = TrufflePrimitive; tp.assert_constant(14 + 2) }.should raise_error(RuntimeError)
14+
-> { tp = TrufflePrimitive; tp.assert_constant(14 + 2) }.should raise_error(NoMethodError, /syntactically/)
1515
end
1616

1717
guard -> { !TruffleRuby.jit? } do

spec/truffle/graal/assert_not_compiled_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
describe "TrufflePrimitive.assert_not_compiled" do
1212

1313
it "raises a RuntimeError when called dynamically" do
14-
-> { tp = TrufflePrimitive; tp.assert_not_compiled }.should raise_error(RuntimeError)
14+
-> { tp = TrufflePrimitive; tp.assert_not_compiled }.should raise_error(NoMethodError, /syntactically/)
1515
end
1616

1717
guard -> { !TruffleRuby.jit? } do

src/annotations/java/org/truffleruby/builtins/Primitive.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
/**
3030
* Raise an error if any of the arguments with a given index is frozen.
31+
* Indexation is same as for {@link #lowerFixnum()}.
3132
*/
3233
int[] raiseIfFrozen() default {};
3334

src/main/ruby/truffleruby/core/truffle/truffle_primitive.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
module TrufflePrimitive
1212

1313
def self.method_missing(name, *args, &block)
14-
raise "TrufflePrimitive.#{name} has to be called syntactically."
14+
raise NoMethodError.new(
15+
"TrufflePrimitive.#{name} has to be called syntactically.", name)
1516
end
1617

1718
end

0 commit comments

Comments
 (0)