opal-rails 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,5 @@
1
- # = require opal-dom
1
+ # = require jquery
2
+ # = require opal-jquery
2
3
 
3
4
  Document.ready? do
4
5
  Spec::Runner.new.run
@@ -1,117 +1,157 @@
1
- // // file lib/opal/spec/autorun.rb
2
- // (function() {
3
- // var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice;
4
- // var __a, __b;
5
- // return (__b = __scope.Document, __b.$ready$p._p = (__a = function() {
6
- //
7
- //
8
- //
9
- // return (__scope.Spec)._scope.Runner.$new().$run()
10
- // }, __a._s = self, __a), __b.$ready$p())
11
- // })();
12
-
13
- // file lib/opal/spec/browser_formatter.rb
1
+ // lib/opal-spec/browser_formatter.rb
14
2
  (function() {
15
- var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __module = __opal.module, __klass = __opal.klass;
16
-
3
+ var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __mm = __opal.mm, __module = __opal.module, __klass = __opal.klass;
4
+
17
5
  return (function(__base){
18
- // line 1, lib/opal/spec/browser_formatter.rb, module Spec
6
+ // line 1, opal-spec/browser_formatter, module Spec
19
7
  function Spec() {};
20
8
  Spec = __module(__base, "Spec", Spec);
21
9
  var Spec_prototype = Spec.prototype, __scope = Spec._scope;
22
10
 
23
11
  (function(__base, __super){
24
- // line 2, lib/opal/spec/browser_formatter.rb, class BrowserFormatter
12
+ // line 2, opal-spec/browser_formatter, class BrowserFormatter
25
13
  function BrowserFormatter() {};
26
14
  BrowserFormatter = __klass(__base, __super, "BrowserFormatter", BrowserFormatter);
27
15
  var BrowserFormatter_prototype = BrowserFormatter.prototype, __scope = BrowserFormatter._scope;
28
- BrowserFormatter_prototype.summary_element = BrowserFormatter_prototype.groups_element = BrowserFormatter_prototype.failed_examples = BrowserFormatter_prototype.group_element = BrowserFormatter_prototype.example_list = BrowserFormatter_prototype.example_group_failed = BrowserFormatter_prototype.examples = nil;
16
+ BrowserFormatter_prototype.start_time = BrowserFormatter_prototype.failed_examples = BrowserFormatter_prototype.summary_element = BrowserFormatter_prototype.groups_element = BrowserFormatter_prototype.example_group_failed = BrowserFormatter_prototype.group_element = BrowserFormatter_prototype.examples = BrowserFormatter_prototype.example_list = nil;
29
17
 
30
18
  __scope.CSS = "\n body {\n font-size: 14px;\n font-family: Helvetica Neue, Helvetica, Arial, sans-serif;\n }\n\n pre {\n font-family: \"Bitstream Vera Sans Mono\", Monaco, \"Lucida Console\", monospace;\n font-size: 12px;\n color: #444444;\n white-space: pre;\n padding: 3px 0px 3px 12px;\n margin: 0px 0px 8px;\n\n background: #FAFAFA;\n -webkit-box-shadow: rgba(0,0,0,0.07) 0 1px 2px inset;\n -webkit-border-radius: 3px;\n -moz-border-radius: 3px;\n border-radius: 3px;\n border: 1px solid #DDDDDD;\n }\n\n ul.example_groups {\n list-style-type: none;\n }\n\n li.group.passed .group_description {\n color: #597800;\n font-weight: bold;\n }\n\n li.group.failed .group_description {\n color: #FF000E;\n font-weight: bold;\n }\n\n li.example.passed {\n color: #597800;\n }\n\n li.example.failed {\n color: #FF000E;\n }\n\n .examples {\n list-style-type: none;\n }\n ";
31
19
 
32
- // line 52, lib/opal/spec/browser_formatter.rb, BrowserFormatter#initialize
20
+ // line 52, opal-spec/browser_formatter, BrowserFormatter#initialize
33
21
  BrowserFormatter_prototype.$initialize = function() {
34
22
 
35
23
  this.examples = [];
36
24
  return this.failed_examples = [];
37
25
  };
38
26
 
39
- // line 57, lib/opal/spec/browser_formatter.rb, BrowserFormatter#start
27
+ // line 57, opal-spec/browser_formatter, BrowserFormatter#start
40
28
  BrowserFormatter_prototype.$start = function() {
41
- var __a;
42
- if ((__a = __scope.Document.$body_ready$p()) === false || __a === nil) {
43
- this.$raise("Not running in browser")
44
- };
45
- this.summary_element = __scope.DOM.$parse("<p class=\"summary\"></p>");
46
- this.summary_element.$append_to_body();
47
- this.groups_element = __scope.DOM.$parse("<ul class=\"example_groups\"></ul>");
48
- this.groups_element.$append_to_body();
49
- return __scope.DOM.$parse("<style>" + __scope.CSS + "</style>").$append_to_head();
29
+
30
+
31
+ if (!document || !document.body) {
32
+ this.$raise("Not running in browser.");
33
+ }
34
+
35
+ var summary_element = document.createElement('p');
36
+ summary_element.className = 'summary';
37
+
38
+ var groups_element = document.createElement('ul');
39
+ groups_element.className = 'example_groups';
40
+
41
+ var target = document.getElementById('opal-spec-output');
42
+
43
+ if (!target) {
44
+ target = document.body;
45
+ }
46
+
47
+ target.appendChild(summary_element);
48
+ target.appendChild(groups_element);
49
+
50
+ var styles = document.createElement('style');
51
+ styles.innerHTML = __scope.CSS;
52
+ document.head.appendChild(styles);
53
+
54
+ this.start_time = __scope.Time.$now().$to_f();
55
+ this.groups_element = groups_element;
56
+ return this.summary_element = summary_element;
50
57
  };
51
58
 
52
- // line 69, lib/opal/spec/browser_formatter.rb, BrowserFormatter#finish
59
+ // line 88, opal-spec/browser_formatter, BrowserFormatter#finish
53
60
  BrowserFormatter_prototype.$finish = function() {
54
- var text = nil;
55
- text = "\n" + this.$example_count() + " examples, " + this.failed_examples.$size() + " failures";
56
- return this.summary_element.$html$e(text);
61
+ var time = nil, text = nil, __a, __b;
62
+ time = (__a = __scope.Time.$now().$to_f(), __b = this.start_time, typeof(__a) === 'number' ? __a - __b : __a['$-'](__b));
63
+ text = "\n" + (this.$example_count()) + " examples, " + (this.failed_examples.$size()) + " failures (time taken: " + (time) + ")";
64
+ return this.summary_element.innerHTML = text;
57
65
  };
58
66
 
59
- // line 75, lib/opal/spec/browser_formatter.rb, BrowserFormatter#example_group_started
67
+ // line 95, opal-spec/browser_formatter, BrowserFormatter#example_group_started
60
68
  BrowserFormatter_prototype.$example_group_started = function(group) {
61
69
 
62
70
  this.example_group = group;
63
71
  this.example_group_failed = false;
64
- this.group_element = __scope.DOM.$parse(" <li>\n <span class=\"group_description\">\n " + group.$description() + "\n </span>\n </li>\n ");
65
- this.example_list = __scope.DOM.$parse(" <ul class=\"examples\"></ul>\n ");
66
- this.group_element.$lshft$(this.example_list);
67
- return this.groups_element.$lshft$(this.group_element);
72
+
73
+ var group_element = document.createElement('li');
74
+
75
+ var description = document.createElement('span');
76
+ description.className = 'group_description';
77
+ description.innerHTML = group.$description();
78
+ group_element.appendChild(description);
79
+
80
+ var example_list = document.createElement('ul');
81
+ example_list.className = 'examples';
82
+ group_element.appendChild(example_list);
83
+
84
+ this.groups_element.appendChild(group_element);
85
+
86
+ this.group_element = group_element;
87
+ return this.example_list = example_list;
68
88
  };
69
89
 
70
- // line 93, lib/opal/spec/browser_formatter.rb, BrowserFormatter#example_group_finished
90
+ // line 118, opal-spec/browser_formatter, BrowserFormatter#example_group_finished
71
91
  BrowserFormatter_prototype.$example_group_finished = function(group) {
72
92
  var __a;
73
93
  if ((__a = this.example_group_failed) !== false && __a !== nil) {
74
- return this.group_element.$class_name$e("group failed")
94
+ return this.group_element.className = 'group failed';
75
95
  } else {
76
- return this.group_element.$class_name$e("group passed")
96
+ return this.group_element.className = 'group passed';
77
97
  };
78
98
  };
79
99
 
80
- // line 101, lib/opal/spec/browser_formatter.rb, BrowserFormatter#example_started
100
+ // line 126, opal-spec/browser_formatter, BrowserFormatter#example_started
81
101
  BrowserFormatter_prototype.$example_started = function(example) {
82
102
 
83
- this.examples.$lshft$(example);
103
+ this.examples['$<<'](example);
84
104
  return this.example = example;
85
105
  };
86
106
 
87
- // line 106, lib/opal/spec/browser_formatter.rb, BrowserFormatter#example_failed
107
+ // line 131, opal-spec/browser_formatter, BrowserFormatter#example_failed
88
108
  BrowserFormatter_prototype.$example_failed = function(example) {
89
- var exception = nil, $case = nil, output = nil, wrapper = nil, description = nil;
90
- this.failed_examples.$lshft$(example);
109
+ var exception = nil, $case = nil, output = nil;
110
+ this.failed_examples['$<<'](example);
91
111
  this.example_group_failed = true;
92
112
  exception = example.$exception();
93
- $case = exception;if ((__scope.Spec)._scope.ExpectationNotMetError.$eqq$($case)) {
113
+ $case = exception;if ((__scope.Spec)._scope.ExpectationNotMetError['$===']($case)) {
94
114
  output = exception.$message()
95
115
  }
96
- else {output = "" + exception.$class() + ": " + exception.$message() + "\n";
97
- output = output.$plus$(" " + exception.$backtrace().$join("\n ") + "\n");};
98
- wrapper = __scope.DOM.$parse("<li class=\"example failed\"></li>");
99
- description = __scope.DOM.$parse(" <span class=\"example_description\">" + example.$description() + "</span>\n ");
100
- exception = __scope.DOM.$parse(" <pre class=\"exception\">" + output + "</pre>\n ");
101
- wrapper.$lshft$(description);
102
- wrapper.$lshft$(exception);
103
- this.example_list.$append(wrapper);
104
- return this.example_list.$css("display", "list-item");
105
- };
106
-
107
- // line 138, lib/opal/spec/browser_formatter.rb, BrowserFormatter#example_passed
116
+ else {output = "" + (exception['$class']()) + ": " + (exception.$message()) + "\n";
117
+ output = output['$+'](" " + (exception.$backtrace().$join("\n ")) + "\n");};
118
+
119
+ var wrapper = document.createElement('li');
120
+ wrapper.className = 'example failed';
121
+
122
+ var description = document.createElement('span');
123
+ description.className = 'example_description';
124
+ description.innerHTML = example.$description();
125
+
126
+ var exception = document.createElement('pre');
127
+ exception.className = 'exception';
128
+ exception.innerHTML = output;
129
+
130
+ wrapper.appendChild(description);
131
+ wrapper.appendChild(exception);
132
+
133
+ this.example_list.appendChild(wrapper);
134
+ this.example_list.style.display = 'list-item';
135
+
136
+ };
137
+
138
+ // line 168, opal-spec/browser_formatter, BrowserFormatter#example_passed
108
139
  BrowserFormatter_prototype.$example_passed = function(example) {
109
- var out = nil;
110
- out = __scope.DOM.$parse(" <li class=\"example passed\">\n <span class=\"example_description\">" + example.$description() + "</span>\n </li>\n ");
111
- return this.example_list.$append(out);
140
+
141
+
142
+ var wrapper = document.createElement('li');
143
+ wrapper.className = 'example passed';
144
+
145
+ var description = document.createElement('span');
146
+ description.className = 'example_description';
147
+ description.innerHTML = example.$description();
148
+
149
+ wrapper.appendChild(description);
150
+ this.example_list.appendChild(wrapper);
151
+
112
152
  };
113
153
 
114
- // line 147, lib/opal/spec/browser_formatter.rb, BrowserFormatter#example_count
154
+ // line 182, opal-spec/browser_formatter, BrowserFormatter#example_count
115
155
  BrowserFormatter_prototype.$example_count = function() {
116
156
 
117
157
  return this.examples.$size();
@@ -121,40 +161,40 @@ var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __brea
121
161
 
122
162
  })(self)
123
163
  })();
124
- // file lib/opal/spec/example.rb
164
+ // lib/opal-spec/example.rb
125
165
  (function() {
126
- var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __module = __opal.module, __klass = __opal.klass;
127
-
166
+ var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __mm = __opal.mm, __module = __opal.module, __klass = __opal.klass;
167
+
128
168
  return (function(__base){
129
- // line 1, lib/opal/spec/example.rb, module Spec
169
+ // line 1, opal-spec/example, module Spec
130
170
  function Spec() {};
131
171
  Spec = __module(__base, "Spec", Spec);
132
172
  var Spec_prototype = Spec.prototype, __scope = Spec._scope;
133
173
 
134
174
  (function(__base, __super){
135
- // line 2, lib/opal/spec/example.rb, class Example
175
+ // line 2, opal-spec/example, class Example
136
176
  function Example() {};
137
177
  Example = __klass(__base, __super, "Example", Example);
138
178
  var Example_prototype = Example.prototype, __scope = Example._scope;
139
179
  Example_prototype.description = Example_prototype.example_group = Example_prototype.exception = Example_prototype.__block__ = nil;
140
180
 
141
- // line 3, lib/opal/spec/example.rb, Example#description
181
+ // line 3, opal-spec/example, Example#description
142
182
  Example_prototype.$description = function() {
143
183
 
144
184
  return this.description
145
185
  },
146
- // line 3, lib/opal/spec/example.rb, Example#example_group
186
+ // line 3, opal-spec/example, Example#example_group
147
187
  Example_prototype.$example_group = function() {
148
188
 
149
189
  return this.example_group
150
190
  },
151
- // line 3, lib/opal/spec/example.rb, Example#exception
191
+ // line 3, opal-spec/example, Example#exception
152
192
  Example_prototype.$exception = function() {
153
193
 
154
194
  return this.exception
155
195
  };
156
196
 
157
- // line 5, lib/opal/spec/example.rb, Example#initialize
197
+ // line 5, opal-spec/example, Example#initialize
158
198
  Example_prototype.$initialize = function(group, desc, block) {
159
199
 
160
200
  this.example_group = group;
@@ -162,7 +202,7 @@ var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __brea
162
202
  return this.__block__ = block;
163
203
  };
164
204
 
165
- // line 11, lib/opal/spec/example.rb, Example#run_before_hooks
205
+ // line 11, opal-spec/example, Example#run_before_hooks
166
206
  Example_prototype.$run_before_hooks = function() {
167
207
  var __a, __b;
168
208
  return (__b = this.example_group.$before_hooks(), __b.$each._p = (__a = function(before) {
@@ -174,7 +214,7 @@ var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __brea
174
214
  }, __a._s = this, __a), __b.$each());
175
215
  };
176
216
 
177
- // line 17, lib/opal/spec/example.rb, Example#run_after_hooks
217
+ // line 17, opal-spec/example, Example#run_after_hooks
178
218
  Example_prototype.$run_after_hooks = function() {
179
219
  var __a, __b;
180
220
  return (__b = this.example_group.$after_hooks(), __b.$each._p = (__a = function(after) {
@@ -186,9 +226,9 @@ var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __brea
186
226
  }, __a._s = this, __a), __b.$each());
187
227
  };
188
228
 
189
- // line 23, lib/opal/spec/example.rb, Example#run
229
+ // line 23, opal-spec/example, Example#run
190
230
  Example_prototype.$run = function(runner) {
191
- var e = nil, __a;
231
+ var e = nil, __a, __b;
192
232
  try {
193
233
  runner.$example_started(this);
194
234
  this.$run_before_hooks();
@@ -206,7 +246,7 @@ var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __brea
206
246
  e = $err;this.exception = e}
207
247
  else { throw $err; }
208
248
  }};
209
- if ((__a = this.exception) !== false && __a !== nil) {
249
+ if ((__b = this.exception) !== false && __b !== nil) {
210
250
  return runner.$example_failed(this)
211
251
  } else {
212
252
  return runner.$example_passed(this)
@@ -217,44 +257,49 @@ var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __brea
217
257
 
218
258
  })(self)
219
259
  })();
220
- // file lib/opal/spec/example_group.rb
260
+ // lib/opal-spec/example_group.rb
221
261
  (function() {
222
- var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __module = __opal.module, __klass = __opal.klass;
223
-
262
+ var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __mm = __opal.mm, __module = __opal.module, __klass = __opal.klass;
263
+
224
264
  return (function(__base){
225
- // line 1, lib/opal/spec/example_group.rb, module Spec
265
+ // line 1, opal-spec/example_group, module Spec
226
266
  function Spec() {};
227
267
  Spec = __module(__base, "Spec", Spec);
228
268
  var Spec_prototype = Spec.prototype, __scope = Spec._scope;
229
269
 
230
270
  (function(__base, __super){
231
- // line 2, lib/opal/spec/example_group.rb, class ExampleGroup
271
+ // line 2, opal-spec/example_group, class ExampleGroup
232
272
  function ExampleGroup() {};
233
273
  ExampleGroup = __klass(__base, __super, "ExampleGroup", ExampleGroup);
234
274
  var ExampleGroup_prototype = ExampleGroup.prototype, __scope = ExampleGroup._scope, TMP_1, TMP_2, TMP_3;
235
- ExampleGroup_prototype.example_groups = ExampleGroup_prototype.stack = ExampleGroup_prototype.examples = ExampleGroup_prototype.before_hooks = ExampleGroup_prototype.after_hooks = ExampleGroup_prototype.parent = ExampleGroup_prototype.desc = nil;
275
+ ExampleGroup_prototype.examples = ExampleGroup_prototype.before_hooks = ExampleGroup_prototype.after_hooks = ExampleGroup_prototype.parent = ExampleGroup_prototype.desc = nil;
236
276
 
237
277
  ExampleGroup.example_groups = [];
238
278
 
239
- // line 4, lib/opal/spec/example_group.rb, ExampleGroup.example_groups
279
+ // line 4, opal-spec/example_group, ExampleGroup.example_groups
240
280
  ExampleGroup.$example_groups = function() {
241
281
 
282
+ if (this.example_groups == null) this.example_groups = nil;
283
+
242
284
  return this.example_groups
243
285
  };
244
286
 
245
287
  ExampleGroup.stack = [];
246
288
 
247
- // line 9, lib/opal/spec/example_group.rb, ExampleGroup.create
289
+ // line 9, opal-spec/example_group, ExampleGroup.create
248
290
  ExampleGroup.$create = function(desc, block) {
249
291
  var group = nil, __a;
250
- group = this.$new(desc, this.stack.$last());
251
- this.example_groups.$lshft$(group);
252
- this.stack.$lshft$(group);
292
+ if (this.stack == null) this.stack = nil;
293
+ if (this.example_groups == null) this.example_groups = nil;
294
+
295
+ group = this['$new'](desc, this.stack.$last());
296
+ this.example_groups['$<<'](group);
297
+ this.stack['$<<'](group);
253
298
  (__a = group, __a.$instance_eval._p = block.$to_proc(), __a.$instance_eval());
254
299
  return this.stack.$pop();
255
300
  };
256
301
 
257
- // line 18, lib/opal/spec/example_group.rb, ExampleGroup#initialize
302
+ // line 18, opal-spec/example_group, ExampleGroup#initialize
258
303
  ExampleGroup_prototype.$initialize = function(desc, parent) {
259
304
 
260
305
  this.desc = desc.$to_s();
@@ -264,47 +309,47 @@ var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __brea
264
309
  return this.after_hooks = [];
265
310
  };
266
311
 
267
- // line 27, lib/opal/spec/example_group.rb, ExampleGroup#it
312
+ // line 27, opal-spec/example_group, ExampleGroup#it
268
313
  ExampleGroup_prototype.$it = TMP_1 = function(desc) {
269
314
  var __context, block;
270
315
  block = TMP_1._p || nil, __context = block._s, TMP_1._p = null;
271
316
 
272
- return this.examples.$lshft$(__scope.Example.$new(this, desc, block));
317
+ return this.examples['$<<'](__scope.Example['$new'](this, desc, block));
273
318
  };
274
319
 
275
- // line 31, lib/opal/spec/example_group.rb, ExampleGroup#it_behaves_like
320
+ // line 31, opal-spec/example_group, ExampleGroup#it_behaves_like
276
321
  ExampleGroup_prototype.$it_behaves_like = function(objs) {
277
322
  objs = __slice.call(arguments, 0);
278
323
  return nil;
279
324
  };
280
325
 
281
- // line 34, lib/opal/spec/example_group.rb, ExampleGroup#before
326
+ // line 34, opal-spec/example_group, ExampleGroup#before
282
327
  ExampleGroup_prototype.$before = TMP_2 = function(type) {
283
328
  var __a, __context, block;
284
329
  block = TMP_2._p || nil, __context = block._s, TMP_2._p = null;
285
330
  if (type == null) {
286
331
  type = "each"
287
332
  }
288
- if ((__a = type.$eq$("each")) === false || __a === nil) {
289
- this.$raise("unsupported before type: " + type)
333
+ if ((__a = type['$==']("each")) === false || __a === nil) {
334
+ this.$raise("unsupported before type: " + (type))
290
335
  };
291
- return this.before_hooks.$lshft$(block);
336
+ return this.before_hooks['$<<'](block);
292
337
  };
293
338
 
294
- // line 39, lib/opal/spec/example_group.rb, ExampleGroup#after
339
+ // line 39, opal-spec/example_group, ExampleGroup#after
295
340
  ExampleGroup_prototype.$after = TMP_3 = function(type) {
296
341
  var __a, __context, block;
297
342
  block = TMP_3._p || nil, __context = block._s, TMP_3._p = null;
298
343
  if (type == null) {
299
344
  type = "each"
300
345
  }
301
- if ((__a = type.$eq$("each")) === false || __a === nil) {
302
- this.$raise("unsupported after type: " + type)
346
+ if ((__a = type['$==']("each")) === false || __a === nil) {
347
+ this.$raise("unsupported after type: " + (type))
303
348
  };
304
- return this.after_hooks.$lshft$(block);
349
+ return this.after_hooks['$<<'](block);
305
350
  };
306
351
 
307
- // line 44, lib/opal/spec/example_group.rb, ExampleGroup#before_hooks
352
+ // line 44, opal-spec/example_group, ExampleGroup#before_hooks
308
353
  ExampleGroup_prototype.$before_hooks = function() {
309
354
  var __a;
310
355
  if ((__a = this.parent) !== false && __a !== nil) {
@@ -314,7 +359,7 @@ var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __brea
314
359
  };
315
360
  };
316
361
 
317
- // line 48, lib/opal/spec/example_group.rb, ExampleGroup#after_hooks
362
+ // line 48, opal-spec/example_group, ExampleGroup#after_hooks
318
363
  ExampleGroup_prototype.$after_hooks = function() {
319
364
  var __a;
320
365
  if ((__a = this.parent) !== false && __a !== nil) {
@@ -324,7 +369,7 @@ var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __brea
324
369
  };
325
370
  };
326
371
 
327
- // line 52, lib/opal/spec/example_group.rb, ExampleGroup#run
372
+ // line 52, opal-spec/example_group, ExampleGroup#run
328
373
  ExampleGroup_prototype.$run = function(runner) {
329
374
  var __a, __b;
330
375
  runner.$example_group_started(this);
@@ -338,11 +383,11 @@ var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __brea
338
383
  return runner.$example_group_finished(this);
339
384
  };
340
385
 
341
- // line 58, lib/opal/spec/example_group.rb, ExampleGroup#description
386
+ // line 58, opal-spec/example_group, ExampleGroup#description
342
387
  ExampleGroup_prototype.$description = function() {
343
388
  var __a;
344
389
  if ((__a = this.parent) !== false && __a !== nil) {
345
- return "" + this.parent.$description() + " " + this.desc
390
+ return "" + (this.parent.$description()) + " " + (this.desc)
346
391
  } else {
347
392
  return this.desc
348
393
  };
@@ -352,18 +397,18 @@ var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __brea
352
397
 
353
398
  })(self)
354
399
  })();
355
- // file lib/opal/spec/expectations.rb
400
+ // lib/opal-spec/expectations.rb
356
401
  (function() {
357
- var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __module = __opal.module, __klass = __opal.klass;
358
-
402
+ var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __mm = __opal.mm, __module = __opal.module, __klass = __opal.klass;
403
+
359
404
  (function(__base){
360
- // line 1, lib/opal/spec/expectations.rb, module Spec
405
+ // line 1, opal-spec/expectations, module Spec
361
406
  function Spec() {};
362
407
  Spec = __module(__base, "Spec", Spec);
363
408
  var Spec_prototype = Spec.prototype, __scope = Spec._scope;
364
409
 
365
410
  (function(__base, __super){
366
- // line 2, lib/opal/spec/expectations.rb, class ExpectationNotMetError
411
+ // line 2, opal-spec/expectations, class ExpectationNotMetError
367
412
  function ExpectationNotMetError() {};
368
413
  ExpectationNotMetError = __klass(__base, __super, "ExpectationNotMetError", ExpectationNotMetError);
369
414
  var ExpectationNotMetError_prototype = ExpectationNotMetError.prototype, __scope = ExpectationNotMetError._scope;
@@ -373,12 +418,12 @@ var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __brea
373
418
  })(Spec, __scope.StandardError);
374
419
 
375
420
  (function(__base){
376
- // line 4, lib/opal/spec/expectations.rb, module Expectations
421
+ // line 4, opal-spec/expectations, module Expectations
377
422
  function Expectations() {};
378
423
  Expectations = __module(__base, "Expectations", Expectations);
379
424
  var Expectations_prototype = Expectations.prototype, __scope = Expectations._scope;
380
425
 
381
- // line 5, lib/opal/spec/expectations.rb, Expectations#should
426
+ // line 5, opal-spec/expectations, Expectations#should
382
427
  Expectations_prototype.$should = function(matcher) {
383
428
  if (matcher == null) {
384
429
  matcher = nil
@@ -386,11 +431,11 @@ var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __brea
386
431
  if (matcher !== false && matcher !== nil) {
387
432
  return matcher.$match(this)
388
433
  } else {
389
- return (__scope.Spec)._scope.PositiveOperatorMatcher.$new(this)
434
+ return (__scope.Spec)._scope.PositiveOperatorMatcher['$new'](this)
390
435
  };
391
436
  };
392
437
 
393
- // line 13, lib/opal/spec/expectations.rb, Expectations#should_not
438
+ // line 13, opal-spec/expectations, Expectations#should_not
394
439
  Expectations_prototype.$should_not = function(matcher) {
395
440
  if (matcher == null) {
396
441
  matcher = nil
@@ -398,51 +443,51 @@ var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __brea
398
443
  if (matcher !== false && matcher !== nil) {
399
444
  return matcher.$not_match(this)
400
445
  } else {
401
- return (__scope.Spec)._scope.NegativeOperatorMatcher.$new(this)
446
+ return (__scope.Spec)._scope.NegativeOperatorMatcher['$new'](this)
402
447
  };
403
448
  };
404
449
 
405
- // line 21, lib/opal/spec/expectations.rb, Expectations#be_kind_of
450
+ // line 21, opal-spec/expectations, Expectations#be_kind_of
406
451
  Expectations_prototype.$be_kind_of = function(expected) {
407
452
 
408
- return (__scope.Spec)._scope.BeKindOfMatcher.$new(expected);
453
+ return (__scope.Spec)._scope.BeKindOfMatcher['$new'](expected);
409
454
  };
410
455
 
411
- // line 25, lib/opal/spec/expectations.rb, Expectations#be_nil
456
+ // line 25, opal-spec/expectations, Expectations#be_nil
412
457
  Expectations_prototype.$be_nil = function() {
413
458
 
414
- return (__scope.Spec)._scope.BeNilMatcher.$new(nil);
459
+ return (__scope.Spec)._scope.BeNilMatcher['$new'](nil);
415
460
  };
416
461
 
417
- // line 29, lib/opal/spec/expectations.rb, Expectations#be_true
462
+ // line 29, opal-spec/expectations, Expectations#be_true
418
463
  Expectations_prototype.$be_true = function() {
419
464
 
420
- return (__scope.Spec)._scope.BeTrueMatcher.$new(true);
465
+ return (__scope.Spec)._scope.BeTrueMatcher['$new'](true);
421
466
  };
422
467
 
423
- // line 33, lib/opal/spec/expectations.rb, Expectations#be_false
468
+ // line 33, opal-spec/expectations, Expectations#be_false
424
469
  Expectations_prototype.$be_false = function() {
425
470
 
426
- return (__scope.Spec)._scope.BeFalseMatcher.$new(false);
471
+ return (__scope.Spec)._scope.BeFalseMatcher['$new'](false);
427
472
  };
428
473
 
429
- // line 37, lib/opal/spec/expectations.rb, Expectations#equal
474
+ // line 37, opal-spec/expectations, Expectations#equal
430
475
  Expectations_prototype.$equal = function(expected) {
431
476
 
432
- return (__scope.Spec)._scope.EqualMatcher.$new(expected);
477
+ return (__scope.Spec)._scope.EqualMatcher['$new'](expected);
433
478
  };
434
479
 
435
- // line 41, lib/opal/spec/expectations.rb, Expectations#raise_error
480
+ // line 41, opal-spec/expectations, Expectations#raise_error
436
481
  Expectations_prototype.$raise_error = function(expected) {
437
482
 
438
- return (__scope.Spec)._scope.RaiseErrorMatcher.$new(expected);
483
+ return (__scope.Spec)._scope.RaiseErrorMatcher['$new'](expected);
439
484
  };
440
485
  ;Expectations._donate(["$should", "$should_not", "$be_kind_of", "$be_nil", "$be_true", "$be_false", "$equal", "$raise_error"]);
441
486
  })(Spec);
442
487
 
443
488
  })(self);
444
489
  return (function(__base, __super){
445
- // line 47, lib/opal/spec/expectations.rb, class Object
490
+ // line 47, opal-spec/expectations, class Object
446
491
  function Object() {};
447
492
  Object = __klass(__base, __super, "Object", Object);
448
493
  var Object_prototype = Object.prototype, __scope = Object._scope;
@@ -451,17 +496,17 @@ var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __brea
451
496
 
452
497
  })(self, null);
453
498
  })();
454
- // file lib/opal/spec/kernel.rb
499
+ // lib/opal-spec/kernel.rb
455
500
  (function() {
456
- var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __module = __opal.module;
457
-
501
+ var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __mm = __opal.mm, __module = __opal.module;
502
+
458
503
  return (function(__base){
459
- // line 1, lib/opal/spec/kernel.rb, module Kernel
504
+ // line 1, opal-spec/kernel, module Kernel
460
505
  function Kernel() {};
461
506
  Kernel = __module(__base, "Kernel", Kernel);
462
507
  var Kernel_prototype = Kernel.prototype, __scope = Kernel._scope, TMP_1;
463
508
 
464
- // line 2, lib/opal/spec/kernel.rb, Kernel#describe
509
+ // line 2, opal-spec/kernel, Kernel#describe
465
510
  Kernel_prototype.$describe = TMP_1 = function(desc) {
466
511
  var __context, block;
467
512
  block = TMP_1._p || nil, __context = block._s, TMP_1._p = null;
@@ -469,37 +514,37 @@ var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __brea
469
514
  return (__scope.Spec)._scope.ExampleGroup.$create(desc, block);
470
515
  };
471
516
 
472
- // line 6, lib/opal/spec/kernel.rb, Kernel#mock
517
+ // line 6, opal-spec/kernel, Kernel#mock
473
518
  Kernel_prototype.$mock = function(obj) {
474
519
 
475
- return __scope.Object.$new();
520
+ return __scope.Object['$new']();
476
521
  };
477
522
  ;Kernel._donate(["$describe", "$mock"]);
478
523
  })(self)
479
524
  })();
480
- // file lib/opal/spec/matchers.rb
525
+ // lib/opal-spec/matchers.rb
481
526
  (function() {
482
- var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __module = __opal.module, __klass = __opal.klass;
483
-
527
+ var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __mm = __opal.mm, __module = __opal.module, __klass = __opal.klass;
528
+
484
529
  return (function(__base){
485
- // line 1, lib/opal/spec/matchers.rb, module Spec
530
+ // line 1, opal-spec/matchers, module Spec
486
531
  function Spec() {};
487
532
  Spec = __module(__base, "Spec", Spec);
488
533
  var Spec_prototype = Spec.prototype, __scope = Spec._scope;
489
534
 
490
535
  (function(__base, __super){
491
- // line 2, lib/opal/spec/matchers.rb, class Matcher
536
+ // line 2, opal-spec/matchers, class Matcher
492
537
  function Matcher() {};
493
538
  Matcher = __klass(__base, __super, "Matcher", Matcher);
494
539
  var Matcher_prototype = Matcher.prototype, __scope = Matcher._scope;
495
540
 
496
- // line 3, lib/opal/spec/matchers.rb, Matcher#initialize
541
+ // line 3, opal-spec/matchers, Matcher#initialize
497
542
  Matcher_prototype.$initialize = function(actual) {
498
543
 
499
544
  return this.actual = actual;
500
545
  };
501
546
 
502
- // line 7, lib/opal/spec/matchers.rb, Matcher#failure
547
+ // line 7, opal-spec/matchers, Matcher#failure
503
548
  Matcher_prototype.$failure = function(message) {
504
549
 
505
550
  return this.$raise((__scope.Spec)._scope.ExpectationNotMetError, message);
@@ -508,138 +553,138 @@ var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __brea
508
553
  })(Spec, null);
509
554
 
510
555
  (function(__base, __super){
511
- // line 12, lib/opal/spec/matchers.rb, class PositiveOperatorMatcher
556
+ // line 12, opal-spec/matchers, class PositiveOperatorMatcher
512
557
  function PositiveOperatorMatcher() {};
513
558
  PositiveOperatorMatcher = __klass(__base, __super, "PositiveOperatorMatcher", PositiveOperatorMatcher);
514
559
  var PositiveOperatorMatcher_prototype = PositiveOperatorMatcher.prototype, __scope = PositiveOperatorMatcher._scope;
515
560
  PositiveOperatorMatcher_prototype.actual = nil;
516
561
 
517
- // line 13, lib/opal/spec/matchers.rb, PositiveOperatorMatcher#==
518
- PositiveOperatorMatcher_prototype.$eq$ = function(expected) {
562
+ // line 13, opal-spec/matchers, PositiveOperatorMatcher#==
563
+ PositiveOperatorMatcher_prototype['$=='] = function(expected) {
519
564
 
520
- if (this.actual.$eq$(expected)) {
565
+ if (this.actual['$=='](expected)) {
521
566
  return true
522
567
  } else {
523
- return this.$failure("expected: " + expected.$inspect() + ", got: " + this.actual.$inspect() + " (using ==).")
568
+ return this.$failure("expected: " + (expected.$inspect()) + ", got: " + (this.actual.$inspect()) + " (using ==).")
524
569
  };
525
570
  }
526
- ;PositiveOperatorMatcher._donate(["$eq$"]);
571
+ ;PositiveOperatorMatcher._donate(["$=="]);
527
572
  })(Spec, __scope.Matcher);
528
573
 
529
574
  (function(__base, __super){
530
- // line 22, lib/opal/spec/matchers.rb, class NegativeOperatorMatcher
575
+ // line 22, opal-spec/matchers, class NegativeOperatorMatcher
531
576
  function NegativeOperatorMatcher() {};
532
577
  NegativeOperatorMatcher = __klass(__base, __super, "NegativeOperatorMatcher", NegativeOperatorMatcher);
533
578
  var NegativeOperatorMatcher_prototype = NegativeOperatorMatcher.prototype, __scope = NegativeOperatorMatcher._scope;
534
579
  NegativeOperatorMatcher_prototype.actual = nil;
535
580
 
536
- // line 23, lib/opal/spec/matchers.rb, NegativeOperatorMatcher#==
537
- NegativeOperatorMatcher_prototype.$eq$ = function(expected) {
581
+ // line 23, opal-spec/matchers, NegativeOperatorMatcher#==
582
+ NegativeOperatorMatcher_prototype['$=='] = function(expected) {
538
583
 
539
- if (this.actual.$eq$(expected)) {
540
- return this.$failure("expected: " + expected.$inspect() + " not to be " + this.actual.$inspect() + " (using ==).")
584
+ if (this.actual['$=='](expected)) {
585
+ return this.$failure("expected: " + (expected.$inspect()) + " not to be " + (this.actual.$inspect()) + " (using ==).")
541
586
  } else {
542
587
  return nil
543
588
  };
544
589
  }
545
- ;NegativeOperatorMatcher._donate(["$eq$"]);
590
+ ;NegativeOperatorMatcher._donate(["$=="]);
546
591
  })(Spec, __scope.Matcher);
547
592
 
548
593
  (function(__base, __super){
549
- // line 30, lib/opal/spec/matchers.rb, class BeKindOfMatcher
594
+ // line 30, opal-spec/matchers, class BeKindOfMatcher
550
595
  function BeKindOfMatcher() {};
551
596
  BeKindOfMatcher = __klass(__base, __super, "BeKindOfMatcher", BeKindOfMatcher);
552
597
  var BeKindOfMatcher_prototype = BeKindOfMatcher.prototype, __scope = BeKindOfMatcher._scope;
553
598
  BeKindOfMatcher_prototype.actual = nil;
554
599
 
555
- // line 31, lib/opal/spec/matchers.rb, BeKindOfMatcher#match
600
+ // line 31, opal-spec/matchers, BeKindOfMatcher#match
556
601
  BeKindOfMatcher_prototype.$match = function(expected) {
557
602
  var __a;
558
- if ((__a = expected.$kind_of$p(this.actual)) !== false && __a !== nil) {
603
+ if ((__a = expected['$kind_of?'](this.actual)) !== false && __a !== nil) {
559
604
  return nil
560
605
  } else {
561
- return this.$failure("expected " + expected.$inspect() + " to be a kind of " + this.actual + ", not " + expected.$class() + ".")
606
+ return this.$failure("expected " + (expected.$inspect()) + " to be a kind of " + (this.actual) + ", not " + (expected['$class']()) + ".")
562
607
  };
563
608
  }
564
609
  ;BeKindOfMatcher._donate(["$match"]);
565
610
  })(Spec, __scope.Matcher);
566
611
 
567
612
  (function(__base, __super){
568
- // line 38, lib/opal/spec/matchers.rb, class BeNilMatcher
613
+ // line 38, opal-spec/matchers, class BeNilMatcher
569
614
  function BeNilMatcher() {};
570
615
  BeNilMatcher = __klass(__base, __super, "BeNilMatcher", BeNilMatcher);
571
616
  var BeNilMatcher_prototype = BeNilMatcher.prototype, __scope = BeNilMatcher._scope;
572
617
 
573
- // line 39, lib/opal/spec/matchers.rb, BeNilMatcher#match
618
+ // line 39, opal-spec/matchers, BeNilMatcher#match
574
619
  BeNilMatcher_prototype.$match = function(expected) {
575
620
  var __a;
576
- if ((__a = expected.$nil$p()) !== false && __a !== nil) {
621
+ if ((__a = expected['$nil?']()) !== false && __a !== nil) {
577
622
  return nil
578
623
  } else {
579
- return this.$failure("expected " + expected.$inspect() + " to be nil.")
624
+ return this.$failure("expected " + (expected.$inspect()) + " to be nil.")
580
625
  };
581
626
  }
582
627
  ;BeNilMatcher._donate(["$match"]);
583
628
  })(Spec, __scope.Matcher);
584
629
 
585
630
  (function(__base, __super){
586
- // line 46, lib/opal/spec/matchers.rb, class BeTrueMatcher
631
+ // line 46, opal-spec/matchers, class BeTrueMatcher
587
632
  function BeTrueMatcher() {};
588
633
  BeTrueMatcher = __klass(__base, __super, "BeTrueMatcher", BeTrueMatcher);
589
634
  var BeTrueMatcher_prototype = BeTrueMatcher.prototype, __scope = BeTrueMatcher._scope;
590
635
 
591
- // line 47, lib/opal/spec/matchers.rb, BeTrueMatcher#match
636
+ // line 47, opal-spec/matchers, BeTrueMatcher#match
592
637
  BeTrueMatcher_prototype.$match = function(expected) {
593
638
 
594
- if (expected.$eq$(true)) {
639
+ if (expected['$=='](true)) {
595
640
  return nil
596
641
  } else {
597
- return this.$failure("expected " + expected.$inspect() + " to be true.")
642
+ return this.$failure("expected " + (expected.$inspect()) + " to be true.")
598
643
  };
599
644
  }
600
645
  ;BeTrueMatcher._donate(["$match"]);
601
646
  })(Spec, __scope.Matcher);
602
647
 
603
648
  (function(__base, __super){
604
- // line 54, lib/opal/spec/matchers.rb, class BeFalseMatcher
649
+ // line 54, opal-spec/matchers, class BeFalseMatcher
605
650
  function BeFalseMatcher() {};
606
651
  BeFalseMatcher = __klass(__base, __super, "BeFalseMatcher", BeFalseMatcher);
607
652
  var BeFalseMatcher_prototype = BeFalseMatcher.prototype, __scope = BeFalseMatcher._scope;
608
653
 
609
- // line 55, lib/opal/spec/matchers.rb, BeFalseMatcher#match
654
+ // line 55, opal-spec/matchers, BeFalseMatcher#match
610
655
  BeFalseMatcher_prototype.$match = function(expected) {
611
656
 
612
- if (expected.$eq$(false)) {
657
+ if (expected['$=='](false)) {
613
658
  return nil
614
659
  } else {
615
- return this.$failure("expected " + expected.$inspect() + " to be false.")
660
+ return this.$failure("expected " + (expected.$inspect()) + " to be false.")
616
661
  };
617
662
  }
618
663
  ;BeFalseMatcher._donate(["$match"]);
619
664
  })(Spec, __scope.Matcher);
620
665
 
621
666
  (function(__base, __super){
622
- // line 62, lib/opal/spec/matchers.rb, class EqualMatcher
667
+ // line 62, opal-spec/matchers, class EqualMatcher
623
668
  function EqualMatcher() {};
624
669
  EqualMatcher = __klass(__base, __super, "EqualMatcher", EqualMatcher);
625
670
  var EqualMatcher_prototype = EqualMatcher.prototype, __scope = EqualMatcher._scope;
626
671
  EqualMatcher_prototype.actual = nil;
627
672
 
628
- // line 63, lib/opal/spec/matchers.rb, EqualMatcher#match
673
+ // line 63, opal-spec/matchers, EqualMatcher#match
629
674
  EqualMatcher_prototype.$match = function(expected) {
630
675
  var __a;
631
- if ((__a = expected.$equal$p(this.actual)) !== false && __a !== nil) {
676
+ if ((__a = expected['$equal?'](this.actual)) !== false && __a !== nil) {
632
677
  return nil
633
678
  } else {
634
- return this.$failure("expected " + this.actual.$inspect() + " to be the same as " + expected.$inspect() + ".")
679
+ return this.$failure("expected " + (this.actual.$inspect()) + " to be the same as " + (expected.$inspect()) + ".")
635
680
  };
636
681
  };
637
682
 
638
- // line 69, lib/opal/spec/matchers.rb, EqualMatcher#not_match
683
+ // line 69, opal-spec/matchers, EqualMatcher#not_match
639
684
  EqualMatcher_prototype.$not_match = function(expected) {
640
685
  var __a;
641
- if ((__a = expected.$equal$p(this.actual)) !== false && __a !== nil) {
642
- return this.$failure("expected " + this.actual.$inspect() + " not to be equal to " + expected.$inspect() + ".")
686
+ if ((__a = expected['$equal?'](this.actual)) !== false && __a !== nil) {
687
+ return this.$failure("expected " + (this.actual.$inspect()) + " not to be equal to " + (expected.$inspect()) + ".")
643
688
  } else {
644
689
  return nil
645
690
  };
@@ -648,13 +693,13 @@ var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __brea
648
693
  })(Spec, __scope.Matcher);
649
694
 
650
695
  (function(__base, __super){
651
- // line 76, lib/opal/spec/matchers.rb, class RaiseErrorMatcher
696
+ // line 76, opal-spec/matchers, class RaiseErrorMatcher
652
697
  function RaiseErrorMatcher() {};
653
698
  RaiseErrorMatcher = __klass(__base, __super, "RaiseErrorMatcher", RaiseErrorMatcher);
654
699
  var RaiseErrorMatcher_prototype = RaiseErrorMatcher.prototype, __scope = RaiseErrorMatcher._scope;
655
700
  RaiseErrorMatcher_prototype.actual = nil;
656
701
 
657
- // line 77, lib/opal/spec/matchers.rb, RaiseErrorMatcher#match
702
+ // line 77, opal-spec/matchers, RaiseErrorMatcher#match
658
703
  RaiseErrorMatcher_prototype.$match = function(block) {
659
704
  var should_raise = nil, e = nil;
660
705
  should_raise = false;
@@ -667,7 +712,7 @@ var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __brea
667
712
  else { throw $err; }
668
713
  };
669
714
  if (should_raise !== false && should_raise !== nil) {
670
- return this.$failure("expected " + this.actual + " to be raised, but nothing was.")
715
+ return this.$failure("expected " + (this.actual) + " to be raised, but nothing was.")
671
716
  } else {
672
717
  return nil
673
718
  };
@@ -677,30 +722,281 @@ var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __brea
677
722
 
678
723
  })(self)
679
724
  })();
680
- // file lib/opal/spec/runner.rb
725
+ // lib/opal-spec/phantom_formatter.rb
681
726
  (function() {
682
- var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __module = __opal.module, __klass = __opal.klass;
727
+ var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __mm = __opal.mm, __module = __opal.module, __klass = __opal.klass;
728
+
729
+ return (function(__base){
730
+ // line 1, opal-spec/phantom_formatter, module Spec
731
+ function Spec() {};
732
+ Spec = __module(__base, "Spec", Spec);
733
+ var Spec_prototype = Spec.prototype, __scope = Spec._scope;
734
+
735
+ (function(__base, __super){
736
+ // line 2, opal-spec/phantom_formatter, class PhantomFormatter
737
+ function PhantomFormatter() {};
738
+ PhantomFormatter = __klass(__base, __super, "PhantomFormatter", PhantomFormatter);
739
+ var PhantomFormatter_prototype = PhantomFormatter.prototype, __scope = PhantomFormatter._scope;
740
+ PhantomFormatter_prototype.failed_examples = PhantomFormatter_prototype.examples = nil;
741
+
742
+ // line 3, opal-spec/phantom_formatter, PhantomFormatter#initialize
743
+ PhantomFormatter_prototype.$initialize = function() {
744
+
745
+ this.examples = [];
746
+ return this.failed_examples = [];
747
+ };
748
+
749
+ // line 8, opal-spec/phantom_formatter, PhantomFormatter#log_green
750
+ PhantomFormatter_prototype.$log_green = function(str) {
751
+
752
+ return console.log('\033[92m' + str + '\033[0m');
753
+ };
754
+
755
+ // line 12, opal-spec/phantom_formatter, PhantomFormatter#log_red
756
+ PhantomFormatter_prototype.$log_red = function(str) {
757
+
758
+ return console.log('\033[31m' + str + '\033[0m');
759
+ };
760
+
761
+ // line 16, opal-spec/phantom_formatter, PhantomFormatter#log
762
+ PhantomFormatter_prototype.$log = function(str) {
763
+
764
+ return console.log(str);
765
+ };
766
+
767
+ // line 20, opal-spec/phantom_formatter, PhantomFormatter#start
768
+ PhantomFormatter_prototype.$start = function() {
769
+
770
+ return nil;
771
+ };
772
+
773
+ // line 23, opal-spec/phantom_formatter, PhantomFormatter#finish
774
+ PhantomFormatter_prototype.$finish = function() {
775
+ var __a, __b;
776
+ if ((__a = this.failed_examples['$empty?']()) !== false && __a !== nil) {
777
+ this.$log("\nFinished");
778
+ this.$log_green("" + (this.$example_count()) + " examples, 0 failures");
779
+ return phantom.exit(0);
780
+ } else {
781
+ this.$log("\nFailures:");
782
+ (__b = this.failed_examples, __b.$each_with_index._p = (__a = function(example, idx) {
783
+
784
+ var exception = nil, $case = nil, output = nil, __a, __b;
785
+ if (example == null) example = nil;
786
+ if (idx == null) idx = nil;
787
+
788
+ this.$log("\n " + ((__a = idx, __b = 1, typeof(__a) === 'number' ? __a + __b : __a['$+'](__b))) + ". " + (example.$example_group().$description()) + " " + (example.$description()));
789
+ exception = example.$exception();
790
+ $case = exception;if ((__scope.Spec)._scope.ExpectationNotMetError['$===']($case)) {
791
+ output = exception.$message()
792
+ }
793
+ else {output = "" + (exception['$class']()) + ": " + (exception.$message()) + "\n";
794
+ output = output['$+'](" " + (exception.$backtrace().$join("\n ")) + "\n");};
795
+ return this.$log_red(" " + (output));
796
+ }, __a._s = this, __a), __b.$each_with_index());
797
+ this.$log("\nFinished");
798
+ this.$log_red("" + (this.$example_count()) + " examples, " + (this.failed_examples.$size()) + " failures");
799
+ return phantom.exit(1);
800
+ };
801
+ };
802
+
803
+ // line 57, opal-spec/phantom_formatter, PhantomFormatter#example_group_started
804
+ PhantomFormatter_prototype.$example_group_started = function(group) {
805
+
806
+ this.example_group = group;
807
+ this.example_group_failed = false;
808
+ return this.$log("\n" + (group.$description()));
809
+ };
810
+
811
+ // line 64, opal-spec/phantom_formatter, PhantomFormatter#example_group_finished
812
+ PhantomFormatter_prototype.$example_group_finished = function(group) {
813
+
814
+ return nil;
815
+ };
816
+
817
+ // line 67, opal-spec/phantom_formatter, PhantomFormatter#example_started
818
+ PhantomFormatter_prototype.$example_started = function(example) {
819
+
820
+ this.examples['$<<'](example);
821
+ return this.example = example;
822
+ };
823
+
824
+ // line 72, opal-spec/phantom_formatter, PhantomFormatter#example_failed
825
+ PhantomFormatter_prototype.$example_failed = function(example) {
826
+
827
+ this.failed_examples['$<<'](example);
828
+ this.example_group_failed = true;
829
+ return this.$log_red(" " + (example.$description()));
830
+ };
683
831
 
832
+ // line 78, opal-spec/phantom_formatter, PhantomFormatter#example_passed
833
+ PhantomFormatter_prototype.$example_passed = function(example) {
834
+
835
+ return this.$log_green(" " + (example.$description()));
836
+ };
837
+
838
+ // line 82, opal-spec/phantom_formatter, PhantomFormatter#example_count
839
+ PhantomFormatter_prototype.$example_count = function() {
840
+
841
+ return this.examples.$size();
842
+ };
843
+ ;PhantomFormatter._donate(["$initialize", "$log_green", "$log_red", "$log", "$start", "$finish", "$example_group_started", "$example_group_finished", "$example_started", "$example_failed", "$example_passed", "$example_count"]);
844
+ })(Spec, null)
845
+
846
+ })(self)
847
+ })();
848
+ // lib/opal-spec/rspec_formatter.rb
849
+ (function() {
850
+ var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __mm = __opal.mm, __module = __opal.module, __klass = __opal.klass;
851
+
684
852
  return (function(__base){
685
- // line 1, lib/opal/spec/runner.rb, module Spec
853
+ // line 1, opal-spec/rspec_formatter, module Spec
686
854
  function Spec() {};
687
855
  Spec = __module(__base, "Spec", Spec);
688
856
  var Spec_prototype = Spec.prototype, __scope = Spec._scope;
689
857
 
690
858
  (function(__base, __super){
691
- // line 2, lib/opal/spec/runner.rb, class Runner
859
+ // line 2, opal-spec/rspec_formatter, class RSpecFormatter
860
+ function RSpecFormatter() {};
861
+ RSpecFormatter = __klass(__base, __super, "RSpecFormatter", RSpecFormatter);
862
+ var RSpecFormatter_prototype = RSpecFormatter.prototype, __scope = RSpecFormatter._scope;
863
+ RSpecFormatter_prototype.spec_collector = RSpecFormatter_prototype.example_group = RSpecFormatter_prototype.examples = RSpecFormatter_prototype.failed_examples = nil;
864
+
865
+ // line 3, opal-spec/rspec_formatter, RSpecFormatter#initialize
866
+ RSpecFormatter_prototype.$initialize = function() {
867
+
868
+ this.examples = [];
869
+ this.failed_examples = [];
870
+ return this.spec_collector = spec_collector;
871
+ };
872
+
873
+ // line 10, opal-spec/rspec_formatter, RSpecFormatter#start
874
+ RSpecFormatter_prototype.$start = function() {
875
+
876
+ return nil;
877
+ };
878
+
879
+ // line 13, opal-spec/rspec_formatter, RSpecFormatter#finish
880
+ RSpecFormatter_prototype.$finish = function() {
881
+
882
+ return nil;
883
+ };
884
+
885
+ // line 16, opal-spec/rspec_formatter, RSpecFormatter#example_group_started
886
+ RSpecFormatter_prototype.$example_group_started = function(group) {
887
+
888
+ this.example_group = group;
889
+ this.example_group_failed = false;
890
+ return this.spec_collector.example_group_started(group.$description());
891
+ };
892
+
893
+ // line 23, opal-spec/rspec_formatter, RSpecFormatter#example_group_finished
894
+ RSpecFormatter_prototype.$example_group_finished = function(group) {
895
+
896
+ return this.spec_collector.example_group_finished(this.example_group.$description());
897
+ };
898
+
899
+ // line 27, opal-spec/rspec_formatter, RSpecFormatter#example_started
900
+ RSpecFormatter_prototype.$example_started = function(example) {
901
+
902
+ this.examples['$<<'](example);
903
+ return this.example = example;
904
+ };
905
+
906
+ // line 32, opal-spec/rspec_formatter, RSpecFormatter#example_failed
907
+ RSpecFormatter_prototype.$example_failed = function(example) {
908
+
909
+ this.failed_examples['$<<'](example);
910
+ this.example_group_failed = true;
911
+ return this.spec_collector.example_failed(example.$description(), example.$exception().$message());
912
+ };
913
+
914
+ // line 38, opal-spec/rspec_formatter, RSpecFormatter#example_passed
915
+ RSpecFormatter_prototype.$example_passed = function(example) {
916
+
917
+ return this.spec_collector.example_passed(example.$description());
918
+ };
919
+
920
+ // line 42, opal-spec/rspec_formatter, RSpecFormatter#example_count
921
+ RSpecFormatter_prototype.$example_count = function() {
922
+
923
+ return this.examples.$size();
924
+ };
925
+ ;RSpecFormatter._donate(["$initialize", "$start", "$finish", "$example_group_started", "$example_group_finished", "$example_started", "$example_failed", "$example_passed", "$example_count"]);
926
+ })(Spec, null)
927
+
928
+ })(self)
929
+ })();
930
+ // lib/opal-spec/runner.rb
931
+ (function() {
932
+ var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __mm = __opal.mm, __module = __opal.module, __klass = __opal.klass;
933
+
934
+ return (function(__base){
935
+ // line 1, opal-spec/runner, module Spec
936
+ function Spec() {};
937
+ Spec = __module(__base, "Spec", Spec);
938
+ var Spec_prototype = Spec.prototype, __scope = Spec._scope;
939
+
940
+ (function(__base, __super){
941
+ // line 2, opal-spec/runner, class Runner
692
942
  function Runner() {};
693
943
  Runner = __klass(__base, __super, "Runner", Runner);
694
944
  var Runner_prototype = Runner.prototype, __scope = Runner._scope;
695
945
  Runner_prototype.formatter = nil;
696
946
 
697
- // line 3, lib/opal/spec/runner.rb, Runner#initialize
698
- Runner_prototype.$initialize = function() {
947
+ // line 3, opal-spec/runner, Runner.in_browser?
948
+ Runner['$in_browser?'] = function() {
949
+
699
950
 
700
- return this.formatter = __scope.BrowserFormatter.$new();
951
+ if (typeof(window) !== 'undefined' && typeof(document) !== 'undefined') {
952
+ return true;
953
+ }
954
+
955
+ return false;
956
+
701
957
  };
702
958
 
703
- // line 7, lib/opal/spec/runner.rb, Runner#run
959
+ // line 13, opal-spec/runner, Runner.in_phantom?
960
+ Runner['$in_phantom?'] = function() {
961
+
962
+
963
+ if (typeof(phantom) !== 'undefined' && phantom.exit) {
964
+ return true;
965
+ }
966
+
967
+ return false;
968
+
969
+ };
970
+
971
+ // line 23, opal-spec/runner, Runner.autorun
972
+ Runner.$autorun = function() {
973
+ var __a;
974
+ if ((__a = this['$in_browser?']()) !== false && __a !== nil) {
975
+
976
+ setTimeout(function() {
977
+ __scope.Runner['$new']().$run();
978
+ }, 0);
979
+
980
+ } else {
981
+ return __scope.Runner['$new']().$run()
982
+ }
983
+ };
984
+
985
+ // line 35, opal-spec/runner, Runner#initialize
986
+ Runner_prototype.$initialize = function() {
987
+ var __a;
988
+ if ((__a = __scope.Runner['$in_phantom?']()) !== false && __a !== nil) {
989
+ return this.formatter = __scope.PhantomFormatter['$new']()
990
+ } else {
991
+ if ((__a = __scope.Runner['$in_browser?']()) !== false && __a !== nil) {
992
+ return this.formatter = __scope.BrowserFormatter['$new']()
993
+ } else {
994
+ return this.formatter = __scope.RSpecFormatter['$new']()
995
+ }
996
+ };
997
+ };
998
+
999
+ // line 45, opal-spec/runner, Runner#run
704
1000
  Runner_prototype.$run = function() {
705
1001
  var groups = nil, __a, __b;
706
1002
  groups = __scope.ExampleGroup.$example_groups();
@@ -715,105 +1011,106 @@ var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __brea
715
1011
  return this.formatter.$finish();
716
1012
  };
717
1013
 
718
- // line 14, lib/opal/spec/runner.rb, Runner#example_group_started
1014
+ // line 52, opal-spec/runner, Runner#example_group_started
719
1015
  Runner_prototype.$example_group_started = function(group) {
720
1016
 
721
1017
  return this.formatter.$example_group_started(group);
722
1018
  };
723
1019
 
724
- // line 18, lib/opal/spec/runner.rb, Runner#example_group_finished
1020
+ // line 56, opal-spec/runner, Runner#example_group_finished
725
1021
  Runner_prototype.$example_group_finished = function(group) {
726
1022
 
727
1023
  return this.formatter.$example_group_finished(group);
728
1024
  };
729
1025
 
730
- // line 22, lib/opal/spec/runner.rb, Runner#example_started
1026
+ // line 60, opal-spec/runner, Runner#example_started
731
1027
  Runner_prototype.$example_started = function(example) {
732
1028
 
733
1029
  return this.formatter.$example_started(example);
734
1030
  };
735
1031
 
736
- // line 26, lib/opal/spec/runner.rb, Runner#example_passed
1032
+ // line 64, opal-spec/runner, Runner#example_passed
737
1033
  Runner_prototype.$example_passed = function(example) {
738
1034
 
739
1035
  return this.formatter.$example_passed(example);
740
1036
  };
741
1037
 
742
- // line 30, lib/opal/spec/runner.rb, Runner#example_failed
1038
+ // line 68, opal-spec/runner, Runner#example_failed
743
1039
  Runner_prototype.$example_failed = function(example) {
744
1040
 
745
1041
  return this.formatter.$example_failed(example);
746
1042
  };
747
- ;Runner._donate(["$initialize", "$run", "$example_group_started", "$example_group_finished", "$example_started", "$example_passed", "$example_failed"]);
1043
+ ;Runner._donate(["$initialize", "$run", "$example_group_started", "$example_group_finished", "$example_started", "$example_passed", "$example_failed"]); ;Runner._sdonate(["$in_browser?", "$in_phantom?", "$autorun"]);
748
1044
  })(Spec, null)
749
1045
 
750
1046
  })(self)
751
1047
  })();
752
- // file lib/opal/spec/scratch_pad.rb
1048
+ // lib/opal-spec/scratch_pad.rb
753
1049
  (function() {
754
- var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __module = __opal.module;
755
-
1050
+ var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __mm = __opal.mm, __module = __opal.module;
1051
+
756
1052
  return (function(__base){
757
- // line 1, lib/opal/spec/scratch_pad.rb, module ScratchPad
1053
+ // line 1, opal-spec/scratch_pad, module ScratchPad
758
1054
  function ScratchPad() {};
759
1055
  ScratchPad = __module(__base, "ScratchPad", ScratchPad);
760
1056
  var ScratchPad_prototype = ScratchPad.prototype, __scope = ScratchPad._scope;
761
1057
 
762
- // line 2, lib/opal/spec/scratch_pad.rb, ScratchPad.clear
1058
+ // line 2, opal-spec/scratch_pad, ScratchPad.clear
763
1059
  ScratchPad.$clear = function() {
764
1060
 
765
1061
  return this.record = nil
766
1062
  };
767
1063
 
768
- // line 6, lib/opal/spec/scratch_pad.rb, ScratchPad.record
1064
+ // line 6, opal-spec/scratch_pad, ScratchPad.record
769
1065
  ScratchPad.$record = function(arg) {
770
1066
 
771
1067
  return this.record = arg
772
1068
  };
773
1069
 
774
- // line 10, lib/opal/spec/scratch_pad.rb, ScratchPad.<<
775
- ScratchPad.$lshft$ = function(arg) {
1070
+ // line 10, opal-spec/scratch_pad, ScratchPad.<<
1071
+ ScratchPad['$<<'] = function(arg) {
776
1072
 
777
1073
  if (this.record == null) this.record = nil;
778
1074
 
779
- return this.record.$lshft$(arg)
1075
+ return this.record['$<<'](arg)
780
1076
  };
781
1077
 
782
- // line 14, lib/opal/spec/scratch_pad.rb, ScratchPad.recorded
1078
+ // line 14, opal-spec/scratch_pad, ScratchPad.recorded
783
1079
  ScratchPad.$recorded = function() {
784
1080
 
785
1081
  if (this.record == null) this.record = nil;
786
1082
 
787
1083
  return this.record
788
1084
  };
789
- ;ScratchPad._sdonate(["$clear", "$record", "$lshft$", "$recorded"]);
1085
+ ;ScratchPad._sdonate(["$clear", "$record", "$<<", "$recorded"]);
790
1086
  })(self)
791
1087
  })();
792
- // file lib/opal/spec/version.rb
1088
+ // lib/opal-spec/version.rb
793
1089
  (function() {
794
- var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __module = __opal.module;
795
-
1090
+ var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __mm = __opal.mm, __module = __opal.module;
1091
+
796
1092
  return (function(__base){
797
- // line 1, lib/opal/spec/version.rb, module Spec
1093
+ // line 1, opal-spec/version, module Spec
798
1094
  function Spec() {};
799
1095
  Spec = __module(__base, "Spec", Spec);
800
1096
  var Spec_prototype = Spec.prototype, __scope = Spec._scope;
801
1097
 
802
- __scope.VERSION = "0.1.9"
1098
+ __scope.VERSION = "0.1.15"
803
1099
 
804
1100
  })(self)
805
1101
  })();
806
- // file lib/opal/spec.rb
1102
+ // lib/opal-spec.rb
807
1103
  (function() {
808
- var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice;
809
-
810
- nil;
811
- nil;
812
- nil;
813
- nil;
814
- nil;
815
- nil;
816
- nil;
817
- nil;
818
- return nil;
1104
+ var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __mm = __opal.mm;
1105
+
1106
+ //= require opal-spec/example;
1107
+ //= require opal-spec/example_group;
1108
+ //= require opal-spec/matchers;
1109
+ //= require opal-spec/runner;
1110
+ //= require opal-spec/scratch_pad;
1111
+ //= require opal-spec/expectations;
1112
+ //= require opal-spec/browser_formatter;
1113
+ //= require opal-spec/phantom_formatter;
1114
+ //= require opal-spec/kernel;
1115
+ return //= require opal-spec/version;
819
1116
  })();