Remove private nest macro

It was still visible to end users.
This commit is contained in:
Michael Miller 2018-08-24 15:17:05 -06:00
parent b90cc39638
commit d5cd756882

View file

@ -6,7 +6,11 @@ end
module Spectator module Spectator
module DSL module DSL
private macro nest(type, what, &block) macro describe(what, type = "Describe", &block)
context({{what}}, {{type}}) {{block}}
end
macro context(what, type = "Context", &block)
{% safe_name = what.id.stringify.gsub(/\W+/, "_") %} {% safe_name = what.id.stringify.gsub(/\W+/, "_") %}
{% module_name = (type.id + safe_name.camelcase).id %} {% module_name = (type.id + safe_name.camelcase).id %}
module {{module_name.id}} module {{module_name.id}}
@ -19,14 +23,6 @@ module Spectator
end end
end end
macro describe(what, &block)
nest("Describe", {{what}}) {{block}}
end
macro context(what, &block)
nest("Context", {{what}}) {{block}}
end
macro it(description, &block) macro it(description, &block)
{% safe_name = description.id.stringify.gsub(/\W+/, "_") %} {% safe_name = description.id.stringify.gsub(/\W+/, "_") %}
{% class_name = (safe_name.camelcase + "Example").id %} {% class_name = (safe_name.camelcase + "Example").id %}