File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -246,11 +246,23 @@ def method_to_be_aliased
246
246
cls . new . test_method . should == :test_method
247
247
end
248
248
249
+ it "returns the correct arity of the method in class" do
250
+ cls = Class . new
251
+ @m . rb_define_method ( cls , "test_method" )
252
+ cls . new . method ( :test_method ) . arity . should == 0
253
+ end
254
+
249
255
it "defines a method on a module" do
250
256
mod = Module . new
251
257
@m . rb_define_method ( mod , "test_method" )
252
258
mod . should have_instance_method ( :test_method )
253
259
end
260
+
261
+ it "returns the correct arity of the method in module" do
262
+ mod = Module . new
263
+ @m . rb_define_method ( mod , "test_method" )
264
+ mod . instance_method ( :test_method ) . arity . should == 0
265
+ end
254
266
end
255
267
256
268
describe "rb_define_module_function" do
@@ -263,12 +275,23 @@ def method_to_be_aliased
263
275
@mod . test_module_function . should == :test_method
264
276
end
265
277
278
+ it "returns the correct arity of the module function" do
279
+ @mod . method ( :test_module_function ) . arity . should == 0
280
+ end
281
+
266
282
it "defines a private instance method" do
267
283
cls = Class . new
268
284
cls . include ( @mod )
269
285
270
286
cls . should have_private_instance_method ( :test_module_function )
271
287
end
288
+
289
+ it "returns the correct arity for private instance method" do
290
+ cls = Class . new
291
+ cls . include ( @mod )
292
+
293
+ @mod . instance_method ( :test_module_function ) . arity . should == 0
294
+ end
272
295
end
273
296
274
297
describe "rb_define_private_method" do
Original file line number Diff line number Diff line change
1
+ fails:CApiModule rb_define_method returns the correct arity of the method in class
2
+ fails:CApiModule rb_define_method returns the correct arity of the method in module
3
+ fails:CApiModule rb_define_module_function returns the correct arity of the module function
4
+ fails:CApiModule rb_define_module_function returns the correct arity for private instance method
You can’t perform that action at this time.
0 commit comments