opal-rails 0.0.6 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. data/.gitignore +7 -3
  2. data/Gemfile +22 -0
  3. data/Rakefile +39 -2
  4. data/app/assets/images/opal-rails/.gitkeep +0 -0
  5. data/app/assets/javascripts/opal-rails/.gitkeep +0 -0
  6. data/app/assets/stylesheets/opal-rails/.gitkeep +0 -0
  7. data/app/controllers/.gitkeep +0 -0
  8. data/app/controllers/opal_spec_controller.rb +8 -0
  9. data/app/helpers/.gitkeep +0 -0
  10. data/app/mailers/.gitkeep +0 -0
  11. data/app/models/.gitkeep +0 -0
  12. data/app/views/.gitkeep +0 -0
  13. data/app/views/layouts/opal_spec.html.erb +17 -0
  14. data/config/routes.rb +3 -0
  15. data/lib/assets/javascripts/opal-spec-runner.js.rb +5 -0
  16. data/lib/assets/javascripts/opal-spec.js +819 -0
  17. data/lib/opal/rails/template_handler.rb +0 -1
  18. data/lib/opal/rails/version.rb +1 -1
  19. data/lib/tasks/opal-rails_tasks.rake +4 -0
  20. data/opal-rails.gemspec +3 -1
  21. data/script/rails +8 -0
  22. data/spec/integration/opal_spec.rb +9 -0
  23. data/spec/opal/rails/processor_spec.rb +4 -0
  24. data/spec/spec_helper.rb +20 -0
  25. data/test_app/.gitignore +15 -0
  26. data/test_app/Rakefile +7 -0
  27. data/test_app/app/assets/images/rails.png +0 -0
  28. data/test_app/app/assets/javascripts/application.js +15 -0
  29. data/test_app/app/assets/javascripts/spec/example_spec.js_spec.rb +5 -0
  30. data/test_app/app/assets/javascripts/spec.js +1 -0
  31. data/test_app/app/assets/stylesheets/application.css +13 -0
  32. data/test_app/app/controllers/application_controller.rb +3 -0
  33. data/test_app/app/views/layouts/application.html.erb +14 -0
  34. data/test_app/config/application.rb +68 -0
  35. data/test_app/config/boot.rb +6 -0
  36. data/test_app/config/environment.rb +5 -0
  37. data/test_app/config/environments/development.rb +31 -0
  38. data/test_app/config/environments/production.rb +64 -0
  39. data/test_app/config/environments/test.rb +35 -0
  40. data/test_app/config/initializers/backtrace_silencers.rb +7 -0
  41. data/test_app/config/initializers/inflections.rb +15 -0
  42. data/test_app/config/initializers/mime_types.rb +5 -0
  43. data/test_app/config/initializers/secret_token.rb +7 -0
  44. data/test_app/config/initializers/session_store.rb +8 -0
  45. data/test_app/config/initializers/wrap_parameters.rb +10 -0
  46. data/test_app/config/locales/en.yml +5 -0
  47. data/test_app/config/routes.rb +58 -0
  48. data/test_app/config.ru +4 -0
  49. data/test_app/lib/assets/.gitkeep +0 -0
  50. data/test_app/lib/tasks/.gitkeep +0 -0
  51. data/test_app/log/.gitkeep +0 -0
  52. data/test_app/public/404.html +26 -0
  53. data/test_app/public/422.html +26 -0
  54. data/test_app/public/500.html +25 -0
  55. data/test_app/public/favicon.ico +0 -0
  56. data/test_app/public/robots.txt +5 -0
  57. data/test_app/script/rails +6 -0
  58. metadata +80 -13
@@ -0,0 +1,819 @@
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
14
+ (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
+
17
+ return (function(__base){
18
+ // line 1, lib/opal/spec/browser_formatter.rb, module Spec
19
+ function Spec() {};
20
+ Spec = __module(__base, "Spec", Spec);
21
+ var Spec_prototype = Spec.prototype, __scope = Spec._scope;
22
+
23
+ (function(__base, __super){
24
+ // line 2, lib/opal/spec/browser_formatter.rb, class BrowserFormatter
25
+ function BrowserFormatter() {};
26
+ BrowserFormatter = __klass(__base, __super, "BrowserFormatter", BrowserFormatter);
27
+ 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;
29
+
30
+ __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
+
32
+ // line 52, lib/opal/spec/browser_formatter.rb, BrowserFormatter#initialize
33
+ BrowserFormatter_prototype.$initialize = function() {
34
+
35
+ this.examples = [];
36
+ return this.failed_examples = [];
37
+ };
38
+
39
+ // line 57, lib/opal/spec/browser_formatter.rb, BrowserFormatter#start
40
+ 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();
50
+ };
51
+
52
+ // line 69, lib/opal/spec/browser_formatter.rb, BrowserFormatter#finish
53
+ 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);
57
+ };
58
+
59
+ // line 75, lib/opal/spec/browser_formatter.rb, BrowserFormatter#example_group_started
60
+ BrowserFormatter_prototype.$example_group_started = function(group) {
61
+
62
+ this.example_group = group;
63
+ 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);
68
+ };
69
+
70
+ // line 93, lib/opal/spec/browser_formatter.rb, BrowserFormatter#example_group_finished
71
+ BrowserFormatter_prototype.$example_group_finished = function(group) {
72
+ var __a;
73
+ if ((__a = this.example_group_failed) !== false && __a !== nil) {
74
+ return this.group_element.$class_name$e("group failed")
75
+ } else {
76
+ return this.group_element.$class_name$e("group passed")
77
+ };
78
+ };
79
+
80
+ // line 101, lib/opal/spec/browser_formatter.rb, BrowserFormatter#example_started
81
+ BrowserFormatter_prototype.$example_started = function(example) {
82
+
83
+ this.examples.$lshft$(example);
84
+ return this.example = example;
85
+ };
86
+
87
+ // line 106, lib/opal/spec/browser_formatter.rb, BrowserFormatter#example_failed
88
+ BrowserFormatter_prototype.$example_failed = function(example) {
89
+ var exception = nil, $case = nil, output = nil, wrapper = nil, description = nil;
90
+ this.failed_examples.$lshft$(example);
91
+ this.example_group_failed = true;
92
+ exception = example.$exception();
93
+ $case = exception;if ((__scope.Spec)._scope.ExpectationNotMetError.$eqq$($case)) {
94
+ output = exception.$message()
95
+ }
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
108
+ 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);
112
+ };
113
+
114
+ // line 147, lib/opal/spec/browser_formatter.rb, BrowserFormatter#example_count
115
+ BrowserFormatter_prototype.$example_count = function() {
116
+
117
+ return this.examples.$size();
118
+ };
119
+ ;BrowserFormatter._donate(["$initialize", "$start", "$finish", "$example_group_started", "$example_group_finished", "$example_started", "$example_failed", "$example_passed", "$example_count"]);
120
+ })(Spec, null)
121
+
122
+ })(self)
123
+ })();
124
+ // file lib/opal/spec/example.rb
125
+ (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
+
128
+ return (function(__base){
129
+ // line 1, lib/opal/spec/example.rb, module Spec
130
+ function Spec() {};
131
+ Spec = __module(__base, "Spec", Spec);
132
+ var Spec_prototype = Spec.prototype, __scope = Spec._scope;
133
+
134
+ (function(__base, __super){
135
+ // line 2, lib/opal/spec/example.rb, class Example
136
+ function Example() {};
137
+ Example = __klass(__base, __super, "Example", Example);
138
+ var Example_prototype = Example.prototype, __scope = Example._scope;
139
+ Example_prototype.description = Example_prototype.example_group = Example_prototype.exception = Example_prototype.__block__ = nil;
140
+
141
+ // line 3, lib/opal/spec/example.rb, Example#description
142
+ Example_prototype.$description = function() {
143
+
144
+ return this.description
145
+ },
146
+ // line 3, lib/opal/spec/example.rb, Example#example_group
147
+ Example_prototype.$example_group = function() {
148
+
149
+ return this.example_group
150
+ },
151
+ // line 3, lib/opal/spec/example.rb, Example#exception
152
+ Example_prototype.$exception = function() {
153
+
154
+ return this.exception
155
+ };
156
+
157
+ // line 5, lib/opal/spec/example.rb, Example#initialize
158
+ Example_prototype.$initialize = function(group, desc, block) {
159
+
160
+ this.example_group = group;
161
+ this.description = desc;
162
+ return this.__block__ = block;
163
+ };
164
+
165
+ // line 11, lib/opal/spec/example.rb, Example#run_before_hooks
166
+ Example_prototype.$run_before_hooks = function() {
167
+ var __a, __b;
168
+ return (__b = this.example_group.$before_hooks(), __b.$each._p = (__a = function(before) {
169
+
170
+ var __a;
171
+ if (before == null) before = nil;
172
+
173
+ return (__a = this, __a.$instance_eval._p = before.$to_proc(), __a.$instance_eval())
174
+ }, __a._s = this, __a), __b.$each());
175
+ };
176
+
177
+ // line 17, lib/opal/spec/example.rb, Example#run_after_hooks
178
+ Example_prototype.$run_after_hooks = function() {
179
+ var __a, __b;
180
+ return (__b = this.example_group.$after_hooks(), __b.$each._p = (__a = function(after) {
181
+
182
+ var __a;
183
+ if (after == null) after = nil;
184
+
185
+ return (__a = this, __a.$instance_eval._p = after.$to_proc(), __a.$instance_eval())
186
+ }, __a._s = this, __a), __b.$each());
187
+ };
188
+
189
+ // line 23, lib/opal/spec/example.rb, Example#run
190
+ Example_prototype.$run = function(runner) {
191
+ var e = nil, __a;
192
+ try {
193
+ runner.$example_started(this);
194
+ this.$run_before_hooks();
195
+ (__a = this, __a.$instance_eval._p = this.__block__.$to_proc(), __a.$instance_eval());
196
+ } catch ($err) {
197
+ if (true) {
198
+ e = $err;this.exception = e}
199
+ else { throw $err; }
200
+ }
201
+ finally {
202
+ try {
203
+ this.$run_after_hooks()
204
+ } catch ($err) {
205
+ if (true) {
206
+ e = $err;this.exception = e}
207
+ else { throw $err; }
208
+ }};
209
+ if ((__a = this.exception) !== false && __a !== nil) {
210
+ return runner.$example_failed(this)
211
+ } else {
212
+ return runner.$example_passed(this)
213
+ };
214
+ };
215
+ ;Example._donate(["$description", "$example_group", "$exception", "$initialize", "$run_before_hooks", "$run_after_hooks", "$run"]);
216
+ })(Spec, null)
217
+
218
+ })(self)
219
+ })();
220
+ // file lib/opal/spec/example_group.rb
221
+ (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
+
224
+ return (function(__base){
225
+ // line 1, lib/opal/spec/example_group.rb, module Spec
226
+ function Spec() {};
227
+ Spec = __module(__base, "Spec", Spec);
228
+ var Spec_prototype = Spec.prototype, __scope = Spec._scope;
229
+
230
+ (function(__base, __super){
231
+ // line 2, lib/opal/spec/example_group.rb, class ExampleGroup
232
+ function ExampleGroup() {};
233
+ ExampleGroup = __klass(__base, __super, "ExampleGroup", ExampleGroup);
234
+ 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;
236
+
237
+ ExampleGroup.example_groups = [];
238
+
239
+ // line 4, lib/opal/spec/example_group.rb, ExampleGroup.example_groups
240
+ ExampleGroup.$example_groups = function() {
241
+
242
+ return this.example_groups
243
+ };
244
+
245
+ ExampleGroup.stack = [];
246
+
247
+ // line 9, lib/opal/spec/example_group.rb, ExampleGroup.create
248
+ ExampleGroup.$create = function(desc, block) {
249
+ var group = nil, __a;
250
+ group = this.$new(desc, this.stack.$last());
251
+ this.example_groups.$lshft$(group);
252
+ this.stack.$lshft$(group);
253
+ (__a = group, __a.$instance_eval._p = block.$to_proc(), __a.$instance_eval());
254
+ return this.stack.$pop();
255
+ };
256
+
257
+ // line 18, lib/opal/spec/example_group.rb, ExampleGroup#initialize
258
+ ExampleGroup_prototype.$initialize = function(desc, parent) {
259
+
260
+ this.desc = desc.$to_s();
261
+ this.parent = parent;
262
+ this.examples = [];
263
+ this.before_hooks = [];
264
+ return this.after_hooks = [];
265
+ };
266
+
267
+ // line 27, lib/opal/spec/example_group.rb, ExampleGroup#it
268
+ ExampleGroup_prototype.$it = TMP_1 = function(desc) {
269
+ var __context, block;
270
+ block = TMP_1._p || nil, __context = block._s, TMP_1._p = null;
271
+
272
+ return this.examples.$lshft$(__scope.Example.$new(this, desc, block));
273
+ };
274
+
275
+ // line 31, lib/opal/spec/example_group.rb, ExampleGroup#it_behaves_like
276
+ ExampleGroup_prototype.$it_behaves_like = function(objs) {
277
+ objs = __slice.call(arguments, 0);
278
+ return nil;
279
+ };
280
+
281
+ // line 34, lib/opal/spec/example_group.rb, ExampleGroup#before
282
+ ExampleGroup_prototype.$before = TMP_2 = function(type) {
283
+ var __a, __context, block;
284
+ block = TMP_2._p || nil, __context = block._s, TMP_2._p = null;
285
+ if (type == null) {
286
+ type = "each"
287
+ }
288
+ if ((__a = type.$eq$("each")) === false || __a === nil) {
289
+ this.$raise("unsupported before type: " + type)
290
+ };
291
+ return this.before_hooks.$lshft$(block);
292
+ };
293
+
294
+ // line 39, lib/opal/spec/example_group.rb, ExampleGroup#after
295
+ ExampleGroup_prototype.$after = TMP_3 = function(type) {
296
+ var __a, __context, block;
297
+ block = TMP_3._p || nil, __context = block._s, TMP_3._p = null;
298
+ if (type == null) {
299
+ type = "each"
300
+ }
301
+ if ((__a = type.$eq$("each")) === false || __a === nil) {
302
+ this.$raise("unsupported after type: " + type)
303
+ };
304
+ return this.after_hooks.$lshft$(block);
305
+ };
306
+
307
+ // line 44, lib/opal/spec/example_group.rb, ExampleGroup#before_hooks
308
+ ExampleGroup_prototype.$before_hooks = function() {
309
+ var __a;
310
+ if ((__a = this.parent) !== false && __a !== nil) {
311
+ return [].$concat(this.parent.$before_hooks()).$concat(this.before_hooks)
312
+ } else {
313
+ return this.before_hooks
314
+ };
315
+ };
316
+
317
+ // line 48, lib/opal/spec/example_group.rb, ExampleGroup#after_hooks
318
+ ExampleGroup_prototype.$after_hooks = function() {
319
+ var __a;
320
+ if ((__a = this.parent) !== false && __a !== nil) {
321
+ return [].$concat(this.parent.$after_hooks()).$concat(this.after_hooks)
322
+ } else {
323
+ return this.after_hooks
324
+ };
325
+ };
326
+
327
+ // line 52, lib/opal/spec/example_group.rb, ExampleGroup#run
328
+ ExampleGroup_prototype.$run = function(runner) {
329
+ var __a, __b;
330
+ runner.$example_group_started(this);
331
+ (__b = this.examples, __b.$each._p = (__a = function(example) {
332
+
333
+
334
+ if (example == null) example = nil;
335
+
336
+ return example.$run(runner)
337
+ }, __a._s = this, __a), __b.$each());
338
+ return runner.$example_group_finished(this);
339
+ };
340
+
341
+ // line 58, lib/opal/spec/example_group.rb, ExampleGroup#description
342
+ ExampleGroup_prototype.$description = function() {
343
+ var __a;
344
+ if ((__a = this.parent) !== false && __a !== nil) {
345
+ return "" + this.parent.$description() + " " + this.desc
346
+ } else {
347
+ return this.desc
348
+ };
349
+ };
350
+ ;ExampleGroup._donate(["$initialize", "$it", "$it_behaves_like", "$before", "$after", "$before_hooks", "$after_hooks", "$run", "$description"]); ;ExampleGroup._sdonate(["$example_groups", "$create"]);
351
+ })(Spec, null)
352
+
353
+ })(self)
354
+ })();
355
+ // file lib/opal/spec/expectations.rb
356
+ (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
+
359
+ (function(__base){
360
+ // line 1, lib/opal/spec/expectations.rb, module Spec
361
+ function Spec() {};
362
+ Spec = __module(__base, "Spec", Spec);
363
+ var Spec_prototype = Spec.prototype, __scope = Spec._scope;
364
+
365
+ (function(__base, __super){
366
+ // line 2, lib/opal/spec/expectations.rb, class ExpectationNotMetError
367
+ function ExpectationNotMetError() {};
368
+ ExpectationNotMetError = __klass(__base, __super, "ExpectationNotMetError", ExpectationNotMetError);
369
+ var ExpectationNotMetError_prototype = ExpectationNotMetError.prototype, __scope = ExpectationNotMetError._scope;
370
+
371
+ nil
372
+
373
+ })(Spec, __scope.StandardError);
374
+
375
+ (function(__base){
376
+ // line 4, lib/opal/spec/expectations.rb, module Expectations
377
+ function Expectations() {};
378
+ Expectations = __module(__base, "Expectations", Expectations);
379
+ var Expectations_prototype = Expectations.prototype, __scope = Expectations._scope;
380
+
381
+ // line 5, lib/opal/spec/expectations.rb, Expectations#should
382
+ Expectations_prototype.$should = function(matcher) {
383
+ if (matcher == null) {
384
+ matcher = nil
385
+ }
386
+ if (matcher !== false && matcher !== nil) {
387
+ return matcher.$match(this)
388
+ } else {
389
+ return (__scope.Spec)._scope.PositiveOperatorMatcher.$new(this)
390
+ };
391
+ };
392
+
393
+ // line 13, lib/opal/spec/expectations.rb, Expectations#should_not
394
+ Expectations_prototype.$should_not = function(matcher) {
395
+ if (matcher == null) {
396
+ matcher = nil
397
+ }
398
+ if (matcher !== false && matcher !== nil) {
399
+ return matcher.$not_match(this)
400
+ } else {
401
+ return (__scope.Spec)._scope.NegativeOperatorMatcher.$new(this)
402
+ };
403
+ };
404
+
405
+ // line 21, lib/opal/spec/expectations.rb, Expectations#be_kind_of
406
+ Expectations_prototype.$be_kind_of = function(expected) {
407
+
408
+ return (__scope.Spec)._scope.BeKindOfMatcher.$new(expected);
409
+ };
410
+
411
+ // line 25, lib/opal/spec/expectations.rb, Expectations#be_nil
412
+ Expectations_prototype.$be_nil = function() {
413
+
414
+ return (__scope.Spec)._scope.BeNilMatcher.$new(nil);
415
+ };
416
+
417
+ // line 29, lib/opal/spec/expectations.rb, Expectations#be_true
418
+ Expectations_prototype.$be_true = function() {
419
+
420
+ return (__scope.Spec)._scope.BeTrueMatcher.$new(true);
421
+ };
422
+
423
+ // line 33, lib/opal/spec/expectations.rb, Expectations#be_false
424
+ Expectations_prototype.$be_false = function() {
425
+
426
+ return (__scope.Spec)._scope.BeFalseMatcher.$new(false);
427
+ };
428
+
429
+ // line 37, lib/opal/spec/expectations.rb, Expectations#equal
430
+ Expectations_prototype.$equal = function(expected) {
431
+
432
+ return (__scope.Spec)._scope.EqualMatcher.$new(expected);
433
+ };
434
+
435
+ // line 41, lib/opal/spec/expectations.rb, Expectations#raise_error
436
+ Expectations_prototype.$raise_error = function(expected) {
437
+
438
+ return (__scope.Spec)._scope.RaiseErrorMatcher.$new(expected);
439
+ };
440
+ ;Expectations._donate(["$should", "$should_not", "$be_kind_of", "$be_nil", "$be_true", "$be_false", "$equal", "$raise_error"]);
441
+ })(Spec);
442
+
443
+ })(self);
444
+ return (function(__base, __super){
445
+ // line 47, lib/opal/spec/expectations.rb, class Object
446
+ function Object() {};
447
+ Object = __klass(__base, __super, "Object", Object);
448
+ var Object_prototype = Object.prototype, __scope = Object._scope;
449
+
450
+ Object.$include((__scope.Spec)._scope.Expectations)
451
+
452
+ })(self, null);
453
+ })();
454
+ // file lib/opal/spec/kernel.rb
455
+ (function() {
456
+ var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __module = __opal.module;
457
+
458
+ return (function(__base){
459
+ // line 1, lib/opal/spec/kernel.rb, module Kernel
460
+ function Kernel() {};
461
+ Kernel = __module(__base, "Kernel", Kernel);
462
+ var Kernel_prototype = Kernel.prototype, __scope = Kernel._scope, TMP_1;
463
+
464
+ // line 2, lib/opal/spec/kernel.rb, Kernel#describe
465
+ Kernel_prototype.$describe = TMP_1 = function(desc) {
466
+ var __context, block;
467
+ block = TMP_1._p || nil, __context = block._s, TMP_1._p = null;
468
+
469
+ return (__scope.Spec)._scope.ExampleGroup.$create(desc, block);
470
+ };
471
+
472
+ // line 6, lib/opal/spec/kernel.rb, Kernel#mock
473
+ Kernel_prototype.$mock = function(obj) {
474
+
475
+ return __scope.Object.$new();
476
+ };
477
+ ;Kernel._donate(["$describe", "$mock"]);
478
+ })(self)
479
+ })();
480
+ // file lib/opal/spec/matchers.rb
481
+ (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
+
484
+ return (function(__base){
485
+ // line 1, lib/opal/spec/matchers.rb, module Spec
486
+ function Spec() {};
487
+ Spec = __module(__base, "Spec", Spec);
488
+ var Spec_prototype = Spec.prototype, __scope = Spec._scope;
489
+
490
+ (function(__base, __super){
491
+ // line 2, lib/opal/spec/matchers.rb, class Matcher
492
+ function Matcher() {};
493
+ Matcher = __klass(__base, __super, "Matcher", Matcher);
494
+ var Matcher_prototype = Matcher.prototype, __scope = Matcher._scope;
495
+
496
+ // line 3, lib/opal/spec/matchers.rb, Matcher#initialize
497
+ Matcher_prototype.$initialize = function(actual) {
498
+
499
+ return this.actual = actual;
500
+ };
501
+
502
+ // line 7, lib/opal/spec/matchers.rb, Matcher#failure
503
+ Matcher_prototype.$failure = function(message) {
504
+
505
+ return this.$raise((__scope.Spec)._scope.ExpectationNotMetError, message);
506
+ };
507
+ ;Matcher._donate(["$initialize", "$failure"]);
508
+ })(Spec, null);
509
+
510
+ (function(__base, __super){
511
+ // line 12, lib/opal/spec/matchers.rb, class PositiveOperatorMatcher
512
+ function PositiveOperatorMatcher() {};
513
+ PositiveOperatorMatcher = __klass(__base, __super, "PositiveOperatorMatcher", PositiveOperatorMatcher);
514
+ var PositiveOperatorMatcher_prototype = PositiveOperatorMatcher.prototype, __scope = PositiveOperatorMatcher._scope;
515
+ PositiveOperatorMatcher_prototype.actual = nil;
516
+
517
+ // line 13, lib/opal/spec/matchers.rb, PositiveOperatorMatcher#==
518
+ PositiveOperatorMatcher_prototype.$eq$ = function(expected) {
519
+
520
+ if (this.actual.$eq$(expected)) {
521
+ return true
522
+ } else {
523
+ return this.$failure("expected: " + expected.$inspect() + ", got: " + this.actual.$inspect() + " (using ==).")
524
+ };
525
+ }
526
+ ;PositiveOperatorMatcher._donate(["$eq$"]);
527
+ })(Spec, __scope.Matcher);
528
+
529
+ (function(__base, __super){
530
+ // line 22, lib/opal/spec/matchers.rb, class NegativeOperatorMatcher
531
+ function NegativeOperatorMatcher() {};
532
+ NegativeOperatorMatcher = __klass(__base, __super, "NegativeOperatorMatcher", NegativeOperatorMatcher);
533
+ var NegativeOperatorMatcher_prototype = NegativeOperatorMatcher.prototype, __scope = NegativeOperatorMatcher._scope;
534
+ NegativeOperatorMatcher_prototype.actual = nil;
535
+
536
+ // line 23, lib/opal/spec/matchers.rb, NegativeOperatorMatcher#==
537
+ NegativeOperatorMatcher_prototype.$eq$ = function(expected) {
538
+
539
+ if (this.actual.$eq$(expected)) {
540
+ return this.$failure("expected: " + expected.$inspect() + " not to be " + this.actual.$inspect() + " (using ==).")
541
+ } else {
542
+ return nil
543
+ };
544
+ }
545
+ ;NegativeOperatorMatcher._donate(["$eq$"]);
546
+ })(Spec, __scope.Matcher);
547
+
548
+ (function(__base, __super){
549
+ // line 30, lib/opal/spec/matchers.rb, class BeKindOfMatcher
550
+ function BeKindOfMatcher() {};
551
+ BeKindOfMatcher = __klass(__base, __super, "BeKindOfMatcher", BeKindOfMatcher);
552
+ var BeKindOfMatcher_prototype = BeKindOfMatcher.prototype, __scope = BeKindOfMatcher._scope;
553
+ BeKindOfMatcher_prototype.actual = nil;
554
+
555
+ // line 31, lib/opal/spec/matchers.rb, BeKindOfMatcher#match
556
+ BeKindOfMatcher_prototype.$match = function(expected) {
557
+ var __a;
558
+ if ((__a = expected.$kind_of$p(this.actual)) !== false && __a !== nil) {
559
+ return nil
560
+ } else {
561
+ return this.$failure("expected " + expected.$inspect() + " to be a kind of " + this.actual + ", not " + expected.$class() + ".")
562
+ };
563
+ }
564
+ ;BeKindOfMatcher._donate(["$match"]);
565
+ })(Spec, __scope.Matcher);
566
+
567
+ (function(__base, __super){
568
+ // line 38, lib/opal/spec/matchers.rb, class BeNilMatcher
569
+ function BeNilMatcher() {};
570
+ BeNilMatcher = __klass(__base, __super, "BeNilMatcher", BeNilMatcher);
571
+ var BeNilMatcher_prototype = BeNilMatcher.prototype, __scope = BeNilMatcher._scope;
572
+
573
+ // line 39, lib/opal/spec/matchers.rb, BeNilMatcher#match
574
+ BeNilMatcher_prototype.$match = function(expected) {
575
+ var __a;
576
+ if ((__a = expected.$nil$p()) !== false && __a !== nil) {
577
+ return nil
578
+ } else {
579
+ return this.$failure("expected " + expected.$inspect() + " to be nil.")
580
+ };
581
+ }
582
+ ;BeNilMatcher._donate(["$match"]);
583
+ })(Spec, __scope.Matcher);
584
+
585
+ (function(__base, __super){
586
+ // line 46, lib/opal/spec/matchers.rb, class BeTrueMatcher
587
+ function BeTrueMatcher() {};
588
+ BeTrueMatcher = __klass(__base, __super, "BeTrueMatcher", BeTrueMatcher);
589
+ var BeTrueMatcher_prototype = BeTrueMatcher.prototype, __scope = BeTrueMatcher._scope;
590
+
591
+ // line 47, lib/opal/spec/matchers.rb, BeTrueMatcher#match
592
+ BeTrueMatcher_prototype.$match = function(expected) {
593
+
594
+ if (expected.$eq$(true)) {
595
+ return nil
596
+ } else {
597
+ return this.$failure("expected " + expected.$inspect() + " to be true.")
598
+ };
599
+ }
600
+ ;BeTrueMatcher._donate(["$match"]);
601
+ })(Spec, __scope.Matcher);
602
+
603
+ (function(__base, __super){
604
+ // line 54, lib/opal/spec/matchers.rb, class BeFalseMatcher
605
+ function BeFalseMatcher() {};
606
+ BeFalseMatcher = __klass(__base, __super, "BeFalseMatcher", BeFalseMatcher);
607
+ var BeFalseMatcher_prototype = BeFalseMatcher.prototype, __scope = BeFalseMatcher._scope;
608
+
609
+ // line 55, lib/opal/spec/matchers.rb, BeFalseMatcher#match
610
+ BeFalseMatcher_prototype.$match = function(expected) {
611
+
612
+ if (expected.$eq$(false)) {
613
+ return nil
614
+ } else {
615
+ return this.$failure("expected " + expected.$inspect() + " to be false.")
616
+ };
617
+ }
618
+ ;BeFalseMatcher._donate(["$match"]);
619
+ })(Spec, __scope.Matcher);
620
+
621
+ (function(__base, __super){
622
+ // line 62, lib/opal/spec/matchers.rb, class EqualMatcher
623
+ function EqualMatcher() {};
624
+ EqualMatcher = __klass(__base, __super, "EqualMatcher", EqualMatcher);
625
+ var EqualMatcher_prototype = EqualMatcher.prototype, __scope = EqualMatcher._scope;
626
+ EqualMatcher_prototype.actual = nil;
627
+
628
+ // line 63, lib/opal/spec/matchers.rb, EqualMatcher#match
629
+ EqualMatcher_prototype.$match = function(expected) {
630
+ var __a;
631
+ if ((__a = expected.$equal$p(this.actual)) !== false && __a !== nil) {
632
+ return nil
633
+ } else {
634
+ return this.$failure("expected " + this.actual.$inspect() + " to be the same as " + expected.$inspect() + ".")
635
+ };
636
+ };
637
+
638
+ // line 69, lib/opal/spec/matchers.rb, EqualMatcher#not_match
639
+ EqualMatcher_prototype.$not_match = function(expected) {
640
+ 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() + ".")
643
+ } else {
644
+ return nil
645
+ };
646
+ };
647
+ ;EqualMatcher._donate(["$match", "$not_match"]);
648
+ })(Spec, __scope.Matcher);
649
+
650
+ (function(__base, __super){
651
+ // line 76, lib/opal/spec/matchers.rb, class RaiseErrorMatcher
652
+ function RaiseErrorMatcher() {};
653
+ RaiseErrorMatcher = __klass(__base, __super, "RaiseErrorMatcher", RaiseErrorMatcher);
654
+ var RaiseErrorMatcher_prototype = RaiseErrorMatcher.prototype, __scope = RaiseErrorMatcher._scope;
655
+ RaiseErrorMatcher_prototype.actual = nil;
656
+
657
+ // line 77, lib/opal/spec/matchers.rb, RaiseErrorMatcher#match
658
+ RaiseErrorMatcher_prototype.$match = function(block) {
659
+ var should_raise = nil, e = nil;
660
+ should_raise = false;
661
+ try {
662
+ block.$call();
663
+ should_raise = true;
664
+ } catch ($err) {
665
+ if (true) {
666
+ e = $err;nil}
667
+ else { throw $err; }
668
+ };
669
+ if (should_raise !== false && should_raise !== nil) {
670
+ return this.$failure("expected " + this.actual + " to be raised, but nothing was.")
671
+ } else {
672
+ return nil
673
+ };
674
+ }
675
+ ;RaiseErrorMatcher._donate(["$match"]);
676
+ })(Spec, __scope.Matcher);
677
+
678
+ })(self)
679
+ })();
680
+ // file lib/opal/spec/runner.rb
681
+ (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;
683
+
684
+ return (function(__base){
685
+ // line 1, lib/opal/spec/runner.rb, module Spec
686
+ function Spec() {};
687
+ Spec = __module(__base, "Spec", Spec);
688
+ var Spec_prototype = Spec.prototype, __scope = Spec._scope;
689
+
690
+ (function(__base, __super){
691
+ // line 2, lib/opal/spec/runner.rb, class Runner
692
+ function Runner() {};
693
+ Runner = __klass(__base, __super, "Runner", Runner);
694
+ var Runner_prototype = Runner.prototype, __scope = Runner._scope;
695
+ Runner_prototype.formatter = nil;
696
+
697
+ // line 3, lib/opal/spec/runner.rb, Runner#initialize
698
+ Runner_prototype.$initialize = function() {
699
+
700
+ return this.formatter = __scope.BrowserFormatter.$new();
701
+ };
702
+
703
+ // line 7, lib/opal/spec/runner.rb, Runner#run
704
+ Runner_prototype.$run = function() {
705
+ var groups = nil, __a, __b;
706
+ groups = __scope.ExampleGroup.$example_groups();
707
+ this.formatter.$start();
708
+ (__b = groups, __b.$each._p = (__a = function(group) {
709
+
710
+
711
+ if (group == null) group = nil;
712
+
713
+ return group.$run(this)
714
+ }, __a._s = this, __a), __b.$each());
715
+ return this.formatter.$finish();
716
+ };
717
+
718
+ // line 14, lib/opal/spec/runner.rb, Runner#example_group_started
719
+ Runner_prototype.$example_group_started = function(group) {
720
+
721
+ return this.formatter.$example_group_started(group);
722
+ };
723
+
724
+ // line 18, lib/opal/spec/runner.rb, Runner#example_group_finished
725
+ Runner_prototype.$example_group_finished = function(group) {
726
+
727
+ return this.formatter.$example_group_finished(group);
728
+ };
729
+
730
+ // line 22, lib/opal/spec/runner.rb, Runner#example_started
731
+ Runner_prototype.$example_started = function(example) {
732
+
733
+ return this.formatter.$example_started(example);
734
+ };
735
+
736
+ // line 26, lib/opal/spec/runner.rb, Runner#example_passed
737
+ Runner_prototype.$example_passed = function(example) {
738
+
739
+ return this.formatter.$example_passed(example);
740
+ };
741
+
742
+ // line 30, lib/opal/spec/runner.rb, Runner#example_failed
743
+ Runner_prototype.$example_failed = function(example) {
744
+
745
+ return this.formatter.$example_failed(example);
746
+ };
747
+ ;Runner._donate(["$initialize", "$run", "$example_group_started", "$example_group_finished", "$example_started", "$example_passed", "$example_failed"]);
748
+ })(Spec, null)
749
+
750
+ })(self)
751
+ })();
752
+ // file lib/opal/spec/scratch_pad.rb
753
+ (function() {
754
+ var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __module = __opal.module;
755
+
756
+ return (function(__base){
757
+ // line 1, lib/opal/spec/scratch_pad.rb, module ScratchPad
758
+ function ScratchPad() {};
759
+ ScratchPad = __module(__base, "ScratchPad", ScratchPad);
760
+ var ScratchPad_prototype = ScratchPad.prototype, __scope = ScratchPad._scope;
761
+
762
+ // line 2, lib/opal/spec/scratch_pad.rb, ScratchPad.clear
763
+ ScratchPad.$clear = function() {
764
+
765
+ return this.record = nil
766
+ };
767
+
768
+ // line 6, lib/opal/spec/scratch_pad.rb, ScratchPad.record
769
+ ScratchPad.$record = function(arg) {
770
+
771
+ return this.record = arg
772
+ };
773
+
774
+ // line 10, lib/opal/spec/scratch_pad.rb, ScratchPad.<<
775
+ ScratchPad.$lshft$ = function(arg) {
776
+
777
+ if (this.record == null) this.record = nil;
778
+
779
+ return this.record.$lshft$(arg)
780
+ };
781
+
782
+ // line 14, lib/opal/spec/scratch_pad.rb, ScratchPad.recorded
783
+ ScratchPad.$recorded = function() {
784
+
785
+ if (this.record == null) this.record = nil;
786
+
787
+ return this.record
788
+ };
789
+ ;ScratchPad._sdonate(["$clear", "$record", "$lshft$", "$recorded"]);
790
+ })(self)
791
+ })();
792
+ // file lib/opal/spec/version.rb
793
+ (function() {
794
+ var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __module = __opal.module;
795
+
796
+ return (function(__base){
797
+ // line 1, lib/opal/spec/version.rb, module Spec
798
+ function Spec() {};
799
+ Spec = __module(__base, "Spec", Spec);
800
+ var Spec_prototype = Spec.prototype, __scope = Spec._scope;
801
+
802
+ __scope.VERSION = "0.1.9"
803
+
804
+ })(self)
805
+ })();
806
+ // file lib/opal/spec.rb
807
+ (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;
819
+ })();