Utility method to define a method and a stub override

This commit is contained in:
Michael Miller 2022-03-12 11:41:47 -07:00
parent 8de457d80c
commit 85cc28c499
No known key found for this signature in database
GPG key ID: 32B47AE8F388A1FF
2 changed files with 6 additions and 1 deletions

View file

@ -19,7 +19,7 @@ module Spectator
{% if name %}@[DoubleName({{name}})]{% end %}
class {{type_name.id}} < {{@type.name}}
{% for key, value in value_methods %}
stub def {{key.id}}
inject_stub def {{key.id}}
{{value}}
end
{% end %}

View file

@ -71,5 +71,10 @@ module Spectator
end
end
end
private macro inject_stub(method)
{{method}}
stub {{method}}
end
end
end