lib/rgot/b.rb in rgot-0.1.4 vs lib/rgot/b.rb in rgot-0.1.5
- old
+ new
@@ -93,10 +93,16 @@
reset_timer
start_timer
if block
block.call(self)
else
- @module.instance_method(@name).bind(@module).call(self)
+ bench_method = @module.instance_method(@name).bind(@module)
+ if bench_method.arity == 0
+ path, line = bench_method.source_location
+ self.skip "#{path}:#{line} `#{bench_method.name}' is not running. It's a benchmark method name, But not have argument"
+ else
+ bench_method.call(self)
+ end
end
stop_timer
end
end
end