forked from sorbet/sorbet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMinitest.h
42 lines (37 loc) · 844 Bytes
/
Minitest.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef SORBET_REWRITER_MINITEST_H
#define SORBET_REWRITER_MINITEST_H
#include "ast/ast.h"
namespace sorbet::rewriter {
/**
* This class desugars things of the form
*
* class MyTest
* describe 'foo' do
* it 'bar' do
* baz
* end
* end
* end
*
* into
*
* class MyTest
* class <class_foo> < self
* sig {void}
* def <test_bar>
* baz
* end
* end
* end
*
* which is sort of a lie in that each `test_` method should actually running in
* its own instance where `.name` returns `test_0001_bar` but I think it is
* close enough for our purposes.
*/
class Minitest final {
public:
static std::vector<ast::ExpressionPtr> run(core::MutableContext ctx, ast::Send *send);
Minitest() = delete;
};
} // namespace sorbet::rewriter
#endif