File: test_macro.rb

package info (click to toggle)
ruby-zeitwerk 2.7.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 732 kB
  • sloc: ruby: 6,240; makefile: 4
file content (8 lines) | stat: -rw-r--r-- 185 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
# frozen_string_literal: true

module TestMacro
  def test(description, &block)
    method_name = "test_#{description}".gsub(/\W/, "_")
    define_method(method_name, &block)
  end
end