forked from sorbet/sorbet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTestCase.h
49 lines (44 loc) · 838 Bytes
/
TestCase.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
43
44
45
46
47
48
49
#ifndef SORBET_REWRITER_TESTCASE_H
#define SORBET_REWRITER_TESTCASE_H
#include "ast/ast.h"
namespace sorbet::rewriter {
/**
* This class desugars any test that includes invocations to `test "string" do ... end`
*
* class MyTest < AnyParent
* setup do
* @a = 1
* end
*
* test "the equality" do
* assert_equal 1, @a
* end
*
* teardown do
* @a = nil
* end
* end
*
* into
*
* class MyTest < AnyParent
* def setup
* @a = 1
* end
*
* def test_the_equality
* assert_equal 1, @a
* end
*
* def teardown
* @a = nil
* end
* end
*/
class TestCase final {
public:
static void run(core::MutableContext ctx, ast::ClassDef *klass);
TestCase() = delete;
};
} // namespace sorbet::rewriter
#endif