File: test_macro.rb

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

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