|
1 | 1 | require('../../support/spec_helper');
|
2 | 2 |
|
3 |
| -describe('Cucumber.SupportCode.StepDefinitionSnippetBuilderSyntax', function() { |
| 3 | +describe('Cucumber.SupportCode.StepDefinitionSnippetBuilderSyntax', function () { |
4 | 4 | var Cucumber = requireLib('cucumber');
|
5 | 5 | var Syntax = Cucumber.SupportCode.StepDefinitionSnippetBuilderSyntax;
|
6 | 6 | var stepDefinitionEndComment = 'express the regexp above with the code you wish you had';
|
7 | 7 |
|
8 | 8 | function testBaseSyntax(syntax) {
|
9 | 9 |
|
10 |
| - describe('getStepDefinitionDocString()', function() { |
11 |
| - it('returns "string"', function() { |
| 10 | + describe('getStepDefinitionDocString()', function () { |
| 11 | + it('returns "string"', function () { |
12 | 12 | expect(syntax.getStepDefinitionDocString()).toBe('string');
|
13 | 13 | });
|
14 | 14 | });
|
15 | 15 |
|
16 |
| - describe('getStepDefinitionDataTable()', function() { |
17 |
| - it('returns "table"', function() { |
| 16 | + describe('getStepDefinitionDataTable()', function () { |
| 17 | + it('returns "table"', function () { |
18 | 18 | expect(syntax.getStepDefinitionDataTable()).toBe('table');
|
19 | 19 | });
|
20 | 20 | });
|
21 | 21 |
|
22 |
| - describe('getStepDefinitionCallback()', function() { |
23 |
| - it('returns "callback"', function() { |
| 22 | + describe('getStepDefinitionCallback()', function () { |
| 23 | + it('returns "callback"', function () { |
24 | 24 | expect(syntax.getStepDefinitionCallback()).toBe('callback');
|
25 | 25 | });
|
26 | 26 | });
|
27 | 27 |
|
28 |
| - describe('getPatternStart()', function() { |
29 |
| - it('returns "/^"', function() { |
| 28 | + describe('getPatternStart()', function () { |
| 29 | + it('returns "/^"', function () { |
30 | 30 | expect(syntax.getPatternStart()).toBe('/^');
|
31 | 31 | });
|
32 | 32 | });
|
33 | 33 |
|
34 |
| - describe('getPatternEnd()', function() { |
35 |
| - it('returns "$/"', function() { |
| 34 | + describe('getPatternEnd()', function () { |
| 35 | + it('returns "$/"', function () { |
36 | 36 | expect(syntax.getPatternEnd()).toBe('$/');
|
37 | 37 | });
|
38 | 38 | });
|
39 | 39 |
|
40 |
| - describe('getContextStepDefinitionFunctionName()', function() { |
41 |
| - it('returns "Given"', function() { |
| 40 | + describe('getContextStepDefinitionFunctionName()', function () { |
| 41 | + it('returns "Given"', function () { |
42 | 42 | expect(syntax.getContextStepDefinitionFunctionName()).toBe('Given');
|
43 | 43 | });
|
44 | 44 | });
|
45 | 45 |
|
46 |
| - describe('getEventStepDefinitionFunctionName()', function() { |
47 |
| - it('returns "When"', function() { |
| 46 | + describe('getEventStepDefinitionFunctionName()', function () { |
| 47 | + it('returns "When"', function () { |
48 | 48 | expect(syntax.getEventStepDefinitionFunctionName()).toBe('When');
|
49 | 49 | });
|
50 | 50 | });
|
51 | 51 |
|
52 |
| - describe('getOutcomeStepDefinitionFunctionName()', function() { |
53 |
| - it('returns "Then"', function() { |
| 52 | + describe('getOutcomeStepDefinitionFunctionName()', function () { |
| 53 | + it('returns "Then"', function () { |
54 | 54 | expect(syntax.getOutcomeStepDefinitionFunctionName()).toBe('Then');
|
55 | 55 | });
|
56 | 56 | });
|
57 | 57 |
|
58 |
| - describe('getNumberMatchingGroup()', function() { |
59 |
| - it('returns (\\d+)', function() { |
| 58 | + describe('getNumberMatchingGroup()', function () { |
| 59 | + it('returns (\\d+)', function () { |
60 | 60 | expect(syntax.getNumberMatchingGroup()).toBe('(\\d+)');
|
61 | 61 | });
|
62 | 62 | });
|
63 | 63 |
|
64 |
| - describe('getQuotedStringMatchingGroup()', function() { |
65 |
| - it('returns "([^"]*)"', function() { |
| 64 | + describe('getQuotedStringMatchingGroup()', function () { |
| 65 | + it('returns "([^"]*)"', function () { |
66 | 66 | expect(syntax.getQuotedStringMatchingGroup()).toBe('"([^"]*)"');
|
67 | 67 | });
|
68 | 68 | });
|
69 | 69 |
|
70 |
| - describe('getFunctionParameterSeparator()', function() { |
71 |
| - it('returns ", "', function() { |
| 70 | + describe('getFunctionParameterSeparator()', function () { |
| 71 | + it('returns ", "', function () { |
72 | 72 | expect(syntax.getFunctionParameterSeparator()).toBe(', ');
|
73 | 73 | });
|
74 | 74 | });
|
75 | 75 |
|
76 |
| - describe('getStepDefinitionEndComment()', function() { |
77 |
| - it('returns "' + stepDefinitionEndComment + '"', function() { |
| 76 | + describe('getStepDefinitionEndComment()', function () { |
| 77 | + it('returns "' + stepDefinitionEndComment + '"', function () { |
78 | 78 | expect(syntax.getStepDefinitionEndComment()).toBe(stepDefinitionEndComment);
|
79 | 79 | });
|
80 | 80 | });
|
81 | 81 |
|
82 | 82 | }
|
83 | 83 |
|
84 |
| - describe('JavaScript', function() { |
| 84 | + describe('JavaScript', function () { |
85 | 85 | var syntax = new Syntax.JavaScript();
|
86 | 86 |
|
87 | 87 | testBaseSyntax(syntax);
|
88 | 88 |
|
89 |
| - describe('getStepDefinitionStart()', function() { |
90 |
| - it('returns "this."', function() { |
| 89 | + describe('getStepDefinitionStart()', function () { |
| 90 | + it('returns "this."', function () { |
91 | 91 | expect(syntax.getStepDefinitionStart()).toBe('this.');
|
92 | 92 | });
|
93 | 93 | });
|
94 | 94 |
|
95 |
| - describe('getStepDefinitionInner1()', function() { |
96 |
| - it('returns "("', function() { |
| 95 | + describe('getStepDefinitionInner1()', function () { |
| 96 | + it('returns "("', function () { |
97 | 97 | expect(syntax.getStepDefinitionInner1()).toBe('(');
|
98 | 98 | });
|
99 | 99 | });
|
100 | 100 |
|
101 |
| - describe('getStepDefinitionInner2()', function() { |
102 |
| - it('returns ", function("', function() { |
103 |
| - expect(syntax.getStepDefinitionInner2()).toBe(', function('); |
| 101 | + describe('getStepDefinitionInner2()', function () { |
| 102 | + it('returns ", function ("', function () { |
| 103 | + expect(syntax.getStepDefinitionInner2()).toBe(', function ('); |
104 | 104 | });
|
105 | 105 | });
|
106 | 106 |
|
107 |
| - describe('getStepDefinitionEnd()', function() { |
| 107 | + describe('getStepDefinitionEnd()', function () { |
108 | 108 | var str = ") {\n // " + stepDefinitionEndComment + "\n callback.pending();\n});\n";
|
109 |
| - it('returns "' + str + '"', function() { |
| 109 | + it('returns "' + str + '"', function () { |
110 | 110 | expect(syntax.getStepDefinitionEnd()).toBe(str);
|
111 | 111 | });
|
112 | 112 | });
|
113 | 113 | });
|
114 | 114 |
|
115 |
| - describe('CoffeeScipt', function() { |
| 115 | + describe('CoffeeScipt', function () { |
116 | 116 | var syntax = new Syntax.CoffeeScript();
|
117 | 117 |
|
118 | 118 | testBaseSyntax(syntax);
|
119 | 119 |
|
120 |
| - describe('getStepDefinitionStart()', function() { |
121 |
| - it('returns "@"', function() { |
| 120 | + describe('getStepDefinitionStart()', function () { |
| 121 | + it('returns "@"', function () { |
122 | 122 | expect(syntax.getStepDefinitionStart()).toBe('@');
|
123 | 123 | });
|
124 | 124 | });
|
125 | 125 |
|
126 |
| - describe('getStepDefinitioninner1()', function() { |
127 |
| - it('returns " "', function() { |
| 126 | + describe('getStepDefinitioninner1()', function () { |
| 127 | + it('returns " "', function () { |
128 | 128 | expect(syntax.getStepDefinitionInner1()).toBe(' ');
|
129 | 129 | });
|
130 | 130 | });
|
131 | 131 |
|
132 |
| - describe('getStepDefinitionInner2()', function() { |
133 |
| - it('returns ", ("', function() { |
| 132 | + describe('getStepDefinitionInner2()', function () { |
| 133 | + it('returns ", ("', function () { |
134 | 134 | expect(syntax.getStepDefinitionInner2()).toBe(', (');
|
135 | 135 | });
|
136 | 136 | });
|
137 | 137 |
|
138 |
| - describe('getStepDefinitionEnd()', function() { |
| 138 | + describe('getStepDefinitionEnd()', function () { |
139 | 139 | var str = ") ->\n # " + stepDefinitionEndComment + "\n callback.pending()\n";
|
140 |
| - it('returns "' + str + '"', function() { |
| 140 | + it('returns "' + str + '"', function () { |
141 | 141 | expect(syntax.getStepDefinitionEnd()).toBe(str);
|
142 | 142 | });
|
143 | 143 | });
|
|
0 commit comments