/* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/version"] = function($opal) { $opal.dynamic_require_severity = "warning"; var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module; $opal.add_stubs([]); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Version'); var def = self.$$proto, $scope = self.$$scope; $opal.cdecl($scope, 'STRING', "3.0.0.beta1") })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec"] = function($opal) { $opal.dynamic_require_severity = "warning"; var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice; $opal.add_stubs(['$require']); self.$require("rspec/core"); return self.$require("rspec/version"); }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/autorun"] = function($opal) { $opal.dynamic_require_severity = "warning"; var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice; $opal.add_stubs(['$require', '$autorun']); self.$require("rspec/core"); return (((($scope.get('RSpec')).$$scope.get('Core'))).$$scope.get('Runner')).$autorun(); }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/core/backport_random"] = function($opal) { $opal.dynamic_require_severity = "warning"; var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass, $range = $opal.range; $opal.add_stubs(['$kind_of?', '$__send__', '$raise', '$inspect', '$message', '$class', '$coerce_to', '$new', '$-', '$seed=', '$times', '$|', '$&', '$[]', '$+', '$[]=', '$^', '$>>', '$odd?', '$===', '$each', '$*', '$>=', '$size', '$max', '$next_state', '$<<', '$/', '$random_32_bits', '$>', '$mask_32_bits', '$<', '$map', '$pack', '$each_with_index', '$state_as_bignum', '$left', '$abs', '$==', '$pop', '$first', '$convert_seed', '$private', '$attr_reader', '$seed_rand', '$coerce_to_int', '$nonzero?', '$new_seed', '$random_float', '$<=', '$_rand_range', '$random_integer', '$random_bytes', '$is_a?', '$seed', '$send', '$state', '$marshal_dump', '$allocate', '$marshal_load', '$end', '$begin', '$!', '$respond_to?', '$exclude_end?', '$loop', '$**', '$rand', '$include']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Core'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Backports'); var def = self.$$proto, $scope = self.$$scope; $opal.defs(self, '$coerce_to', function(obj, cls, meth) { var $a, self = this, ret = nil, e = nil; if ((($a = obj['$kind_of?'](cls)) !== nil && (!$a.$$is_boolean || $a == true))) { return obj}; try { ret = obj.$__send__(meth) } catch ($err) {if ($opal.$rescue($err, [$scope.get('Exception')])) {e = $err; self.$raise($scope.get('TypeError'), "Coercion error: " + (obj.$inspect()) + "." + (meth) + " => " + (cls) + " failed:\n" + ("(" + (e.$message()) + ")")) }else { throw $err; } }; if ((($a = ret['$kind_of?'](cls)) !== nil && (!$a.$$is_boolean || $a == true))) { } else { self.$raise($scope.get('TypeError'), "Coercion error: obj." + (meth) + " did NOT return a " + (cls) + " (was " + (ret.$class()) + ")") }; return ret; }); $opal.defs(self, '$coerce_to_int', function(obj) { var self = this; return self.$coerce_to(obj, $scope.get('Integer'), "to_int"); }); $opal.cdecl($scope, 'Undefined', $scope.get('Object').$new()); (function($base, $super) { function $Random(){}; var self = $Random = $klass($base, $super, 'Random', $Random); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $MT19937(){}; var self = $MT19937 = $klass($base, $super, 'MT19937', $MT19937); var def = self.$$proto, $scope = self.$$scope; def.state = def.last_read = nil; $opal.cdecl($scope, 'STATE_SIZE', 624); $opal.cdecl($scope, 'LAST_STATE', $scope.get('STATE_SIZE')['$-'](1)); $opal.cdecl($scope, 'PAD_32_BITS', 4294967295); def.$initialize = function(seed) { var $a, $b, self = this; return (($a = [seed]), $b = self, $b['$seed='].apply($b, $a), $a[$a.length-1]); }; $opal.cdecl($scope, 'LAST_31_BITS', 2147483647); $opal.cdecl($scope, 'OFFSET', 397); def.$next_state = function() { var $a, $b, TMP_1, self = this; ($a = ($b = $scope.get('STATE_SIZE')).$times, $a.$$p = (TMP_1 = function(i){var self = TMP_1.$$s || this, $a, $b, mix = nil; if (self.state == null) self.state = nil; if (i == null) i = nil; mix = self.state['$[]'](i)['$&'](2147483648)['$|'](self.state['$[]'](i['$+'](1)['$-']($scope.get('STATE_SIZE')))['$&'](2147483647)); self.state['$[]='](i, self.state['$[]'](i['$+']($scope.get('OFFSET'))['$-']($scope.get('STATE_SIZE')))['$^']((mix['$>>'](1)))); if ((($a = mix['$odd?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return ($a = i, $b = self.state, $b['$[]=']($a, $b['$[]']($a)['$^'](2567483615))) } else { return nil };}, TMP_1.$$s = self, TMP_1), $a).call($b); return self.last_read = -1; }; def['$seed='] = function(seed) { var $a, $b, TMP_2, $c, TMP_3, $d, TMP_4, self = this, $case = nil, j = nil; return (function() {$case = seed;if ($scope.get('Integer')['$===']($case)) {self.state = $scope.get('Array').$new($scope.get('STATE_SIZE')); self.state['$[]='](0, seed['$&']($scope.get('PAD_32_BITS'))); ($a = ($b = ($range(1, $scope.get('LAST_STATE'), false))).$each, $a.$$p = (TMP_2 = function(i){var self = TMP_2.$$s || this; if (self.state == null) self.state = nil; if (i == null) i = nil; return self.state['$[]='](i, ((1812433253)['$*']((self.state['$[]'](i['$-'](1))['$^'](self.state['$[]'](i['$-'](1))['$>>'](30))))['$+'](i))['$&']($scope.get('PAD_32_BITS')))}, TMP_2.$$s = self, TMP_2), $a).call($b); return self.last_read = $scope.get('LAST_STATE');}else if ($scope.get('Array')['$===']($case)) {(($a = [19650218]), $c = self, $c['$seed='].apply($c, $a), $a[$a.length-1]); i = 1; j = 0; ($a = ($c = [$scope.get('STATE_SIZE'), seed.$size()].$max()).$times, $a.$$p = (TMP_3 = function(){var self = TMP_3.$$s || this; if (self.state == null) self.state = nil; self.state['$[]='](i, (self.state['$[]'](i)['$^']((self.state['$[]'](i['$-'](1))['$^'](self.state['$[]'](i['$-'](1))['$>>'](30)))['$*'](1664525)))['$+'](j)['$+'](seed['$[]'](j))['$&']($scope.get('PAD_32_BITS'))); if (((i = i['$+'](1)))['$>=']($scope.get('STATE_SIZE'))) { self.state['$[]='](0, self.state['$[]'](-1)); i = 1;}; if (((j = j['$+'](1)))['$>='](seed.$size())) { return j = 0 } else { return nil };}, TMP_3.$$s = self, TMP_3), $a).call($c); ($a = ($d = ($scope.get('STATE_SIZE')['$-'](1))).$times, $a.$$p = (TMP_4 = function(){var self = TMP_4.$$s || this; if (self.state == null) self.state = nil; self.state['$[]='](i, (self.state['$[]'](i)['$^']((self.state['$[]'](i['$-'](1))['$^'](self.state['$[]'](i['$-'](1))['$>>'](30)))['$*'](1566083941)))['$-'](i)['$&']($scope.get('PAD_32_BITS'))); if (((i = i['$+'](1)))['$>=']($scope.get('STATE_SIZE'))) { self.state['$[]='](0, self.state['$[]'](-1)); return i = 1; } else { return nil };}, TMP_4.$$s = self, TMP_4), $a).call($d); return self.state['$[]='](0, 2147483648);}else {return self.$raise($scope.get('ArgumentError'), "Seed must be an Integer or an Array")}})(); }; def.$random_32_bits = function() { var self = this, y = nil; if (self.last_read['$>=']($scope.get('LAST_STATE'))) { self.$next_state()}; self.last_read = self.last_read['$+'](1); y = self.state['$[]'](self.last_read); y = y['$^']((y['$>>'](11))); y = y['$^']((y['$<<'](7))['$&'](2636928640)); y = y['$^']((y['$<<'](15))['$&'](4022730752)); return y = y['$^']((y['$>>'](18))); }; $opal.cdecl($scope, 'FLOAT_FACTOR', (1.0)['$/'](9.007199254740992e+15)); def.$random_float = function() { var self = this; return ((self.$random_32_bits()['$>>'](5))['$*'](67108864.0)['$+']((self.$random_32_bits()['$>>'](6))))['$*']($scope.get('FLOAT_FACTOR')); }; def.$random_integer = function(upto) { var $a, $b, $c, TMP_5, self = this, n = nil, nb_full_32 = nil, mask = nil, rand = nil; n = upto['$-'](1); nb_full_32 = 0; while (n['$>']($scope.get('PAD_32_BITS'))) { n = n['$>>'](32); nb_full_32 = nb_full_32['$+'](1);}; mask = self.$mask_32_bits(n); while (!(rand['$<'](upto))) { rand = self.$random_32_bits()['$&'](mask); ($b = ($c = nb_full_32).$times, $b.$$p = (TMP_5 = function(){var self = TMP_5.$$s || this; rand = rand['$<<'](32); return rand = rand['$|'](self.$random_32_bits());}, TMP_5.$$s = self, TMP_5), $b).call($c);}; return rand; }; def.$random_bytes = function(nb) { var $a, $b, TMP_6, self = this, nb_32_bits = nil, random = nil; nb_32_bits = (nb['$+'](3))['$/'](4); random = ($a = ($b = nb_32_bits.$times()).$map, $a.$$p = (TMP_6 = function(){var self = TMP_6.$$s || this; return self.$random_32_bits()}, TMP_6.$$s = self, TMP_6), $a).call($b); return random.$pack("L"['$*'](nb_32_bits))['$[]'](0, nb); }; def.$state_as_bignum = function() { var $a, $b, TMP_7, self = this, b = nil; b = 0; ($a = ($b = self.state).$each_with_index, $a.$$p = (TMP_7 = function(val, i){var self = TMP_7.$$s || this; if (val == null) val = nil;if (i == null) i = nil; return b = b['$|'](val['$<<'](((32)['$*'](i))))}, TMP_7.$$s = self, TMP_7), $a).call($b); return b; }; def.$left = function() { var self = this; return (($scope.get('MT19937')).$$scope.get('STATE_SIZE'))['$-'](self.last_read); }; def.$marshal_dump = function() { var self = this; return [self.$state_as_bignum(), self.$left()]; }; def.$marshal_load = function(ary) { var $a, $b, TMP_8, self = this, b = nil, left = nil; $a = $opal.to_ary(ary), b = ($a[0] == null ? nil : $a[0]), left = ($a[1] == null ? nil : $a[1]); self.last_read = (($scope.get('MT19937')).$$scope.get('STATE_SIZE'))['$-'](left); self.state = $scope.get('Array').$new($scope.get('STATE_SIZE')); return ($a = ($b = $scope.get('STATE_SIZE')).$times, $a.$$p = (TMP_8 = function(i){var self = TMP_8.$$s || this; if (self.state == null) self.state = nil; if (i == null) i = nil; self.state['$[]='](i, b['$&']($scope.get('PAD_32_BITS'))); return b = b['$>>'](32);}, TMP_8.$$s = self, TMP_8), $a).call($b); }; $opal.defs(self, '$convert_seed', function(seed) { var $a, $b, self = this, long_values = nil; seed = seed.$abs(); long_values = []; while (!(seed['$=='](0))) { long_values['$<<']((seed['$&']($scope.get('PAD_32_BITS')))); seed = seed['$>>'](32);}; if ((($a = (($b = long_values['$[]'](-1)['$=='](1)) ? long_values.$size()['$>'](1) : $b)) !== nil && (!$a.$$is_boolean || $a == true))) { long_values.$pop()}; if (long_values.$size()['$>'](1)) { return long_values } else { return long_values.$first() }; }); $opal.defs(self, '$[]', function(seed) { var self = this; return self.$new(self.$convert_seed(seed)); }); self.$private(); $opal.cdecl($scope, 'MASK_BY', [1, 2, 4, 8, 16]); return (def.$mask_32_bits = function(n) { var $a, $b, TMP_9, self = this; ($a = ($b = $scope.get('MASK_BY')).$each, $a.$$p = (TMP_9 = function(shift){var self = TMP_9.$$s || this; if (shift == null) shift = nil; return n = n['$|'](n['$>>'](shift))}, TMP_9.$$s = self, TMP_9), $a).call($b); return n; }, nil) && 'mask_32_bits'; })(self, null); (function($base) { var self = $module($base, 'Implementation'); var def = self.$$proto, $scope = self.$$scope, TMP_10; self.$attr_reader("seed"); def.$initialize = TMP_10 = function(seed) { var self = this, $iter = TMP_10.$$p, $yield = $iter || nil; if (seed == null) { seed = 0 } TMP_10.$$p = null; $opal.find_super_dispatcher(self, 'initialize', TMP_10, null).apply(self, []); return self.$seed_rand(seed); }; def.$seed_rand = function(new_seed) { var $a, $b, self = this, old = nil; if (self.seed == null) self.seed = nil; if (new_seed == null) { new_seed = 0 } new_seed = $scope.get('Backports').$coerce_to_int(new_seed); if ((($a = (($b = self['seed'], $b != null && $b !== nil) ? 'instance-variable' : nil)) !== nil && (!$a.$$is_boolean || $a == true))) { } else { self.seed = nil }; $a = [self.seed, ((($b = new_seed['$nonzero?']()) !== false && $b !== nil) ? $b : $scope.get('Random').$new_seed())], old = $a[0], self.seed = $a[1]; self.mt = $scope.get('MT19937')['$[]'](self.seed); return old; }; def.$rand = function(limit) { var $a, self = this, $case = nil; if (self.mt == null) self.mt = nil; if (limit == null) { limit = (($scope.get('Backports')).$$scope.get('Undefined')) } return ((($a = (function() {$case = limit;if ((($scope.get('Backports')).$$scope.get('Undefined'))['$===']($case)) {return self.mt.$random_float()}else if ($scope.get('Float')['$===']($case)) {if (limit['$<='](0)) { return nil } else { return limit['$*'](self.mt.$random_float()) }}else if ($scope.get('Range')['$===']($case)) {return self.$_rand_range(limit)}else {limit = $scope.get('Backports').$coerce_to_int(limit); if (limit['$<='](0)) { return nil } else { return self.mt.$random_integer(limit) };}})()) !== false && $a !== nil) ? $a : self.$raise($scope.get('ArgumentError'), "invalid argument " + (limit))); }; def.$bytes = function(nb) { var self = this; if (self.mt == null) self.mt = nil; nb = $scope.get('Backports').$coerce_to_int(nb); if (nb['$<'](0)) { self.$raise($scope.get('ArgumentError'), "negative size")}; return self.mt.$random_bytes(nb); }; def['$=='] = function(other) { var $a, $b, $c, self = this; return ($a = ($b = ($c = other['$is_a?']($scope.get('Random')), $c !== false && $c !== nil ?self.$seed()['$=='](other.$seed()) : $c), $b !== false && $b !== nil ?self.$left()['$=='](other.$send("left")) : $b), $a !== false && $a !== nil ?self.$state()['$=='](other.$send("state")) : $a); }; def.$marshal_dump = function() { var self = this; if (self.mt == null) self.mt = nil; if (self.seed == null) self.seed = nil; return self.mt.$marshal_dump()['$<<'](self.seed); }; def.$marshal_load = function(ary) { var self = this; if (self.mt == null) self.mt = nil; self.seed = ary.$pop(); self.mt = $scope.get('MT19937').$allocate(); return self.mt.$marshal_load(ary); }; self.$private(); def.$state = function() { var self = this; if (self.mt == null) self.mt = nil; return self.mt.$state_as_bignum(); }; def.$left = function() { var self = this; if (self.mt == null) self.mt = nil; return self.mt.$left(); }; def.$_rand_range = function(limit) { var $a, $b, $c, TMP_11, self = this, range = nil; if (self.mt == null) self.mt = nil; range = limit.$end()['$-'](limit.$begin()); if ((($a = ($b = ($c = (range['$is_a?']($scope.get('Float'))['$!']()), $c !== false && $c !== nil ?range['$respond_to?']("to_int") : $c), $b !== false && $b !== nil ?range = $scope.get('Backports').$coerce_to_int(range) : $b)) !== nil && (!$a.$$is_boolean || $a == true))) { if ((($a = limit['$exclude_end?']()) !== nil && (!$a.$$is_boolean || $a == true))) { } else { range = range['$+'](1) }; if (range['$<='](0)) { return nil } else { return limit.$begin()['$+'](self.mt.$random_integer(range)) }; } else if ((($a = range = $scope.get('Backports').$coerce_to(range, $scope.get('Float'), "to_f")) !== nil && (!$a.$$is_boolean || $a == true))) { if (range['$<'](0)) { return nil } else if ((($a = limit['$exclude_end?']()) !== nil && (!$a.$$is_boolean || $a == true))) { if (range['$<='](0)) { return nil } else { return limit.$begin()['$+'](self.mt.$random_float()['$*'](range)) } } else { return ($a = ($b = self).$loop, $a.$$p = (TMP_11 = function(){var self = TMP_11.$$s || this, r = nil; if (self.mt == null) self.mt = nil; r = self.mt.$random_float()['$*'](range)['$*'](1.0001); if (r['$>'](range)) { return nil } else { return ($breaker.$v = limit.$begin()['$+'](r), $breaker) };}, TMP_11.$$s = self, TMP_11), $a).call($b) } } else { return nil }; }; ;$opal.donate(self, ["$initialize", "$seed_rand", "$rand", "$bytes", "$==", "$marshal_dump", "$marshal_load", "$state", "$left", "$_rand_range"]); })(self); return ($opal.defs(self, '$new_seed', function() { var self = this; return ((2)['$**'](62))['$+']($scope.get('Kernel').$rand((2)['$**'](62))); }), nil) && 'new_seed'; })(self, null); (function($base, $super) { function $Random(){}; var self = $Random = $klass($base, $super, 'Random', $Random); var def = self.$$proto, $scope = self.$$scope; self.$include($scope.get('Implementation')); return (function(self) { var $scope = self.$$scope, def = self.$$proto; return self.$include($scope.get('Implementation')) })(self.$singleton_class()); })(self, null); })(self) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/core/backtrace_formatter"] = function($opal) { $opal.dynamic_require_severity = "warning"; var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass, $hash2 = $opal.hash2; $opal.add_stubs(['$format_backtrace', '$backtrace_formatter', '$configuration', '$attr_accessor', '$<<', '$union', '$map', '$new', '$gsub', '$getwd', '$empty?', '$[]', '$tap', '$concat', '$compact', '$backtrace_line', '$take_while', '$!', '$==', '$exclude?', '$relative_path', '$any?', '$=~', '$none?']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Core'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $BacktraceFormatter(){}; var self = $BacktraceFormatter = $klass($base, $super, 'BacktraceFormatter', $BacktraceFormatter); var def = self.$$proto, $scope = self.$$scope; def.full_backtrace = def.exclusion_patterns = def.inclusion_patterns = nil; $opal.defs(self, '$format_backtrace', function(backtrace, options) { var self = this; if (options == null) { options = $hash2([], {}) } return $scope.get('RSpec').$configuration().$backtrace_formatter().$format_backtrace(backtrace, options); }); self.$attr_accessor("exclusion_patterns", "inclusion_patterns"); def.$initialize = function() { var $a, $b, $c, TMP_1, self = this; self.full_backtrace = false; self.exclusion_patterns = []['$<<'](($a = $scope.get('Regexp')).$union.apply($a, [].concat(($b = ($c = ["/libd*/ruby/", "org/jruby/", "bin/", "/gems/", "lib/rspec/(core|expectations|matchers|mocks)"]).$map, $b.$$p = (TMP_1 = function(s){var self = TMP_1.$$s || this; if (s == null) s = nil; return $scope.get('Regexp').$new(s.$gsub("/", (($scope.get('File')).$$scope.get('SEPARATOR'))))}, TMP_1.$$s = self, TMP_1), $b).call($c)))); return self.inclusion_patterns = [$scope.get('Regexp').$new($scope.get('Dir').$getwd())]; }; def['$full_backtrace='] = function(full_backtrace) { var self = this; return self.full_backtrace = full_backtrace; }; def['$full_backtrace?'] = function() { var $a, self = this; return ((($a = self.full_backtrace) !== false && $a !== nil) ? $a : self.exclusion_patterns['$empty?']()); }; def.$format_backtrace = function(backtrace, options) { var $a, $b, TMP_2, $c, $d, TMP_3, $e, $f, TMP_4, self = this; if (options == null) { options = $hash2([], {}) } if ((($a = options['$[]']("full_backtrace")) !== nil && (!$a.$$is_boolean || $a == true))) { return backtrace}; return ($a = ($b = ($c = ($d = ($e = ($f = backtrace).$take_while, $e.$$p = (TMP_4 = function(l){var self = TMP_4.$$s || this; if (l == null) l = nil; return l['$==']((((((($scope.get('RSpec')).$$scope.get('Core'))).$$scope.get('Runner'))).$$scope.get('AT_EXIT_HOOK_BACKTRACE_LINE')))['$!']()}, TMP_4.$$s = self, TMP_4), $e).call($f)).$map, $c.$$p = (TMP_3 = function(l){var self = TMP_3.$$s || this; if (l == null) l = nil; return self.$backtrace_line(l)}, TMP_3.$$s = self, TMP_3), $c).call($d).$compact()).$tap, $a.$$p = (TMP_2 = function(filtered){var self = TMP_2.$$s || this, $a; if (filtered == null) filtered = nil; if ((($a = filtered['$empty?']()) !== nil && (!$a.$$is_boolean || $a == true))) { filtered.$concat(backtrace); filtered['$<<'](""); filtered['$<<'](" Showing full backtrace because every line was filtered out."); filtered['$<<'](" See docs for RSpec::Configuration#backtrace_exclusion_patterns and"); return filtered['$<<'](" RSpec::Configuration#backtrace_inclusion_patterns for more information."); } else { return nil }}, TMP_2.$$s = self, TMP_2), $a).call($b); }; def.$backtrace_line = function(line) { var $a, self = this; try { if ((($a = self['$exclude?'](line)) !== nil && (!$a.$$is_boolean || $a == true))) { return nil } else { return (((($scope.get('RSpec')).$$scope.get('Core'))).$$scope.get('Metadata')).$relative_path(line) } } catch ($err) {if ($opal.$rescue($err, [$scope.get('SecurityError')])) { return nil }else { throw $err; } }; }; return (def['$exclude?'] = function(line) { var $a, $b, $c, TMP_5, $d, TMP_6, self = this; if ((($a = self.full_backtrace) !== nil && (!$a.$$is_boolean || $a == true))) { return false}; return ($a = ($b = ($c = self.exclusion_patterns)['$any?'], $b.$$p = (TMP_5 = function(p){var self = TMP_5.$$s || this; if (p == null) p = nil; return p['$=~'](line)}, TMP_5.$$s = self, TMP_5), $b).call($c), $a !== false && $a !== nil ?($b = ($d = self.inclusion_patterns)['$none?'], $b.$$p = (TMP_6 = function(p){var self = TMP_6.$$s || this; if (p == null) p = nil; return p['$=~'](line)}, TMP_6.$$s = self, TMP_6), $b).call($d) : $a); }, nil) && 'exclude?'; })(self, null) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/core/command_line"] = function($opal) { $opal.dynamic_require_severity = "warning"; var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass, $gvars = $opal.gvars; $opal.add_stubs(['$===', '$new', '$parse_options', '$configuration', '$world', '$error_stream=', '$==', '$output_stream', '$output_stream=', '$configure', '$load_spec_files', '$announce_filters', '$report', '$run_hook', '$all?', '$map', '$run', '$ordered_example_groups', '$failure_exit_code', '$reporter', '$example_count']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Core'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $CommandLine(){}; var self = $CommandLine = $klass($base, $super, 'CommandLine', $CommandLine); var def = self.$$proto, $scope = self.$$scope; def.configuration = def.options = def.world = nil; def.$initialize = function(options, configuration, world) { var $a, self = this; if (configuration == null) { configuration = $scope.get('RSpec').$configuration() } if (world == null) { world = $scope.get('RSpec').$world() } if ((($a = $scope.get('Array')['$==='](options)) !== nil && (!$a.$$is_boolean || $a == true))) { options = $scope.get('ConfigurationOptions').$new(options); options.$parse_options();}; self.options = options; self.configuration = configuration; return self.world = world; }; return (def.$run = function(err, out) { var $a, $b, TMP_1, self = this; if ($gvars.stdout == null) $gvars.stdout = nil; (($a = [err]), $b = self.configuration, $b['$error_stream='].apply($b, $a), $a[$a.length-1]); if (self.configuration.$output_stream()['$==']($gvars.stdout)) { (($a = [out]), $b = self.configuration, $b['$output_stream='].apply($b, $a), $a[$a.length-1])}; self.options.$configure(self.configuration); self.configuration.$load_spec_files(); self.world.$announce_filters(); return ($a = ($b = self.configuration.$reporter()).$report, $a.$$p = (TMP_1 = function(reporter){var self = TMP_1.$$s || this, $a, $b, $c, TMP_2; if (self.configuration == null) self.configuration = nil; if (self.world == null) self.world = nil; if (reporter == null) reporter = nil; try { self.configuration.$run_hook("before", "suite"); if ((($a = ($b = ($c = self.world.$ordered_example_groups()).$map, $b.$$p = (TMP_2 = function(g){var self = TMP_2.$$s || this; if (g == null) g = nil; return g.$run(reporter)}, TMP_2.$$s = self, TMP_2), $b).call($c)['$all?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return 0 } else { return self.configuration.$failure_exit_code() }; } finally { self.configuration.$run_hook("after", "suite") }}, TMP_1.$$s = self, TMP_1), $a).call($b, self.world.$example_count()); }, nil) && 'run'; })(self, null) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/core/configuration"] = function($opal) { $opal.dynamic_require_severity = "warning"; var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass, $hash2 = $opal.hash2, $gvars = $opal.gvars, $range = $opal.range; $opal.add_stubs(['$require', '$include', '$define_method', '$instance_variable_defined?', '$instance_variable_get', '$value_for', '$deprecate', '$alias_method', '$define_predicate_for', '$each', '$has_key?', '$raise', '$[]', '$deprecate_alias_key', '$define_aliases', '$attr_writer', '$define_reader', '$Array', '$add_setting', '$!', '$equal?', '$warn', '$+', '$inspect', '$output_stream', '$first_non_rspec_line', '$warning', '$attr_accessor', '$attr_reader', '$new', '$force', '$ordering_manager', '$merge!', '$warnings=', '$clear', '$delete', '$class_eval', '$send', '$mock_with', '$exclusion_patterns', '$exclusion_patterns=', '$inclusion_patterns', '$inclusion_patterns=', '$===', '$to_s', '$map', '$respond_to?', '$framework_name', '$==', '$assert_no_example_groups_defined', '$configuration', '$empty?', '$expect_with', '$expecting_with_rspec=', '$any?', '$-', '$>', '$length', '$first', '$push', '$full_backtrace?', '$full_backtrace=', '$output_to_tty?', '$windows_os?', '$unshift', '$filter_run', '$to_i', '$fetch', '$filter', '$union', '$built_in_formatter', '$custom_formatter', '$<<', '$formatters', '$file_at', '$add_formatter', '$deprecation_stream', '$is_a?', '$flatten', '$command', '$running_in_drb?', '$default_path', '$files_to_run=', '$get_files_to_run', '$build_hash_from', '$alias_example_to', '$alias_it_behaves_like_to', '$include_with_low_priority', '$filter_manager', '$include!', '$inclusions', '$exclude_with_low_priority', '$exclude!', '$exclusions', '$include_or_extend_modules', '$any_apply?', '$<', '$select', '$directory?', '$add_to_load_path', '$>=', '$to_f', '$extend', '$include?', '$included_modules', '$mock_framework', '$expectation_frameworks', '$load', '$expand_path', '$uniq', '$files_to_run', '$lambda', '$__send__', '$to_proc', '$delegate_to_ordering_manager', '$module_eval', '$let', '$deprecation_stream=', '$private', '$sort', '$flat_map', '$gsub', '$gather_directories', '$extract_location', '$pattern', '$=~', '$escape', '$split', '$add_location', '$last', '$example_groups', '$world', '$tty?', '$string_const?', '$inject', '$const_get', '$path_for', '$retry', '$underscore_with_fix_for_non_standard_rspec_naming', '$sub', '$underscore', '$dup', '$gsub!', '$tr!', '$downcase!', '$mkdir_p', '$dirname']); self.$require("fileutils"); self.$require("rspec/core/backtrace_formatter"); self.$require("rspec/core/ruby_project"); self.$require("rspec/core/formatters/deprecation_formatter"); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Core'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Configuration(){}; var self = $Configuration = $klass($base, $super, 'Configuration', $Configuration); var def = self.$$proto, $scope = self.$$scope, TMP_6, TMP_8, $a, $b, TMP_19, TMP_20; def.reporter = def.output_stream = def.spec_files_loaded = def.preferred_options = def.formatters = def.mock_framework = def.backtrace_formatter = def.expectation_frameworks = def.color = def.requires = def.profile_examples = def.format_docstrings_block = nil; self.$include((((($scope.get('RSpec')).$$scope.get('Core'))).$$scope.get('Hooks'))); (function($base, $super) { function $MustBeConfiguredBeforeExampleGroupsError(){}; var self = $MustBeConfiguredBeforeExampleGroupsError = $klass($base, $super, 'MustBeConfiguredBeforeExampleGroupsError', $MustBeConfiguredBeforeExampleGroupsError); var def = self.$$proto, $scope = self.$$scope; return nil; })(self, $scope.get('StandardError')); $opal.defs(self, '$define_reader', function(name) { var $a, $b, TMP_1, self = this; return ($a = ($b = self).$define_method, $a.$$p = (TMP_1 = function(){var self = TMP_1.$$s || this, $a, variable = nil; variable = (function() {if ((($a = self['$instance_variable_defined?']("@" + (name))) !== nil && (!$a.$$is_boolean || $a == true))) { return self.$instance_variable_get("@" + (name)) } else { return nil }; return nil; })(); return self.$value_for(name, variable);}, TMP_1.$$s = self, TMP_1), $a).call($b, name); }); $opal.defs(self, '$deprecate_alias_key', function() { var self = this; return $scope.get('RSpec').$deprecate("add_setting with :alias option", $hash2(["replacement"], {"replacement": ":alias_with"})); }); $opal.defs(self, '$define_aliases', function(name, alias_name) { var self = this; self.$alias_method(alias_name, name); self.$alias_method("" + (alias_name) + "=", "" + (name) + "="); return self.$define_predicate_for(alias_name); }); $opal.defs(self, '$define_predicate_for', function(names) { var $a, $b, TMP_2, self = this; names = $slice.call(arguments, 0); return ($a = ($b = names).$each, $a.$$p = (TMP_2 = function(name){var self = TMP_2.$$s || this; if (name == null) name = nil; return self.$alias_method("" + (name) + "?", name)}, TMP_2.$$s = self, TMP_2), $a).call($b); }); $opal.defs(self, '$add_setting', function(name, opts) { var $a, $b, TMP_3, self = this; if (opts == null) { opts = $hash2([], {}) } if ((($a = opts['$has_key?']("default")) !== nil && (!$a.$$is_boolean || $a == true))) { self.$raise("Use the instance add_setting method if you want to set a default")}; if ((($a = opts['$[]']("alias")) !== nil && (!$a.$$is_boolean || $a == true))) { self.$deprecate_alias_key(); self.$define_aliases(opts['$[]']("alias"), name); } else { self.$attr_writer(name); self.$define_reader(name); self.$define_predicate_for(name); }; return ($a = ($b = self.$Array(opts['$[]']("alias_with"))).$each, $a.$$p = (TMP_3 = function(alias_name){var self = TMP_3.$$s || this; if (alias_name == null) alias_name = nil; return self.$define_aliases(name, alias_name)}, TMP_3.$$s = self, TMP_3), $a).call($b); }); self.$add_setting("default_path"); self.$add_setting("drb"); self.$add_setting("drb_port"); self.$add_setting("error_stream"); self.$add_setting("deprecation_stream"); self.$add_setting("fail_fast"); self.$add_setting("dry_run"); self.$add_setting("failure_exit_code"); self.$define_reader("requires"); self.$define_reader("libs"); self.$define_reader("output_stream"); def['$output_stream='] = function(value) { var $a, $b, self = this; if ((($a = ($b = self.reporter, $b !== false && $b !== nil ?value['$equal?'](self.output_stream)['$!']() : $b)) !== nil && (!$a.$$is_boolean || $a == true))) { return self.$warn("RSpec's reporter has already been initialized with "['$+']("" + (self.$output_stream().$inspect()) + " as the output stream, so your change to ")['$+']("`output_stream` will be ignored. You should configure it earlier for ")['$+']("it to take effect. (Called from " + ($scope.get('CallerFilter').$first_non_rspec_line()) + ")")) } else { return self.output_stream = value }; }; self.$add_setting("pattern", $hash2(["alias_with"], {"alias_with": "filename_pattern"})); def['$pattern='] = function(value) { var $a, self = this; if ((($a = self.spec_files_loaded) !== nil && (!$a.$$is_boolean || $a == true))) { $scope.get('RSpec').$warning("Configuring `pattern` to " + (value) + " has no effect since RSpec has already loaded the spec files.")}; return self.pattern = value; }; $opal.defn(self, '$filename_pattern=', def['$pattern=']); self.$add_setting("profile_examples"); self.$add_setting("run_all_when_everything_filtered"); self.$add_setting("success_color"); self.$add_setting("pending_color"); self.$add_setting("failure_color"); self.$add_setting("default_color"); self.$add_setting("fixed_color"); self.$add_setting("detail_color"); self.$add_setting("show_failures_in_pending_blocks"); def['$treat_symbols_as_metadata_keys_with_true_values='] = function(value) { var self = this; return $scope.get('RSpec').$deprecate("RSpec::Core::Configuration#treat_symbols_as_metadata_keys_with_true_values="); }; self.$add_setting("tty"); self.$add_setting("include_or_extend_modules"); self.$add_setting("files_to_run"); self.$add_setting("expecting_with_rspec"); self.$attr_accessor("filter_manager"); self.$attr_reader("backtrace_formatter", "ordering_manager"); $opal.defn(self, '$backtrace_cleaner', def.$backtrace_formatter); def.$initialize = function() { var self = this; if ($gvars.stderr == null) $gvars.stderr = nil; if ($gvars.stdout == null) $gvars.stdout = nil; self.expectation_frameworks = []; self.include_or_extend_modules = []; self.mock_framework = nil; self.files_to_run = []; self.formatters = []; self.color = false; self.pattern = "**/*_spec.rb"; self.failure_exit_code = 1; self.spec_files_loaded = false; self.backtrace_formatter = $scope.get('BacktraceFormatter').$new(); self.default_path = "spec"; self.deprecation_stream = $gvars.stderr; self.output_stream = $gvars.stdout; self.reporter = nil; self.filter_manager = $scope.get('FilterManager').$new(); self.ordering_manager = (($scope.get('Ordering')).$$scope.get('ConfigurationManager')).$new(); self.preferred_options = $hash2([], {}); self.failure_color = "red"; self.success_color = "green"; self.pending_color = "yellow"; self.default_color = "white"; self.fixed_color = "blue"; self.detail_color = "cyan"; self.profile_examples = false; self.requires = []; return self.libs = []; }; def.$force = function(hash) { var $a, $b, self = this; self.$ordering_manager().$force(hash); self.preferred_options['$merge!'](hash); return (($a = [self.$value_for("warnings", nil)]), $b = self, $b['$warnings='].apply($b, $a), $a[$a.length-1]); }; def.$reset = function() { var self = this; self.spec_files_loaded = false; self.reporter = nil; return self.formatters.$clear(); }; def.$add_setting = function(name, opts) { var $a, $b, TMP_4, self = this, default$ = nil; if (opts == null) { opts = $hash2([], {}) } default$ = opts.$delete("default"); ($a = ($b = ((function(self) { var $scope = self.$$scope, def = self.$$proto; return self })(self.$singleton_class()))).$class_eval, $a.$$p = (TMP_4 = function(){var self = TMP_4.$$s || this; return self.$add_setting(name, opts)}, TMP_4.$$s = self, TMP_4), $a).call($b); if (default$ !== false && default$ !== nil) { return self.$send("" + (name) + "=", default$) } else { return nil }; }; def.$mock_framework = function() { var $a, self = this; if ((($a = self.mock_framework) !== nil && (!$a.$$is_boolean || $a == true))) { } else { self.$mock_with("rspec") }; return self.mock_framework; }; def['$mock_framework='] = function(framework) { var self = this; return self.$mock_with(framework); }; def.$backtrace_exclusion_patterns = function() { var self = this; return self.backtrace_formatter.$exclusion_patterns(); }; def['$backtrace_exclusion_patterns='] = function(patterns) { var $a, $b, self = this; return (($a = [patterns]), $b = self.backtrace_formatter, $b['$exclusion_patterns='].apply($b, $a), $a[$a.length-1]); }; def.$backtrace_inclusion_patterns = function() { var self = this; return self.backtrace_formatter.$inclusion_patterns(); }; def['$backtrace_inclusion_patterns='] = function(patterns) { var $a, $b, self = this; return (($a = [patterns]), $b = self.backtrace_formatter, $b['$inclusion_patterns='].apply($b, $a), $a[$a.length-1]); }; def.$mock_with = TMP_6 = function(framework) { var $a, $b, $c, TMP_5, self = this, $iter = TMP_6.$$p, $yield = $iter || nil, framework_module = nil, $case = nil, new_name = nil, old_name = nil; TMP_6.$$p = null; framework_module = (function() {$case = framework;if ($scope.get('Module')['$===']($case)) {return framework}else if ($scope.get('String')['$===']($case) || $scope.get('Symbol')['$===']($case)) {self.$require((function() {$case = framework.$to_s();if (/rspec/i['$===']($case)) {return "rspec/core/mocking/with_rspec"}else if (/mocha/i['$===']($case)) {return "rspec/core/mocking/with_mocha"}else if (/rr/i['$===']($case)) {return "rspec/core/mocking/with_rr"}else if (/flexmock/i['$===']($case)) {return "rspec/core/mocking/with_flexmock"}else {return "rspec/core/mocking/with_absolutely_nothing"}})()); return (((($scope.get('RSpec')).$$scope.get('Core'))).$$scope.get('MockFrameworkAdapter'));}else { return nil }})(); $a = $opal.to_ary(($b = ($c = [framework_module, self.mock_framework]).$map, $b.$$p = (TMP_5 = function(mod){var self = TMP_5.$$s || this, $a; if (mod == null) mod = nil; if ((($a = mod['$respond_to?']("framework_name")) !== nil && (!$a.$$is_boolean || $a == true))) { return mod.$framework_name() } else { return "unnamed" }}, TMP_5.$$s = self, TMP_5), $b).call($c)), new_name = ($a[0] == null ? nil : $a[0]), old_name = ($a[1] == null ? nil : $a[1]); if (new_name['$=='](old_name)) { } else { self.$assert_no_example_groups_defined("mock_framework") }; if (($yield !== nil)) { if ((($a = framework_module['$respond_to?']("configuration")) !== nil && (!$a.$$is_boolean || $a == true))) { } else { self.$raise("" + (framework_module) + " must respond to `configuration` so that mock_with can yield it.") }; if ($opal.$yield1($yield, framework_module.$configuration()) === $breaker) return $breaker.$v;}; return self.mock_framework = framework_module; }; def.$expectation_frameworks = function() { var $a, self = this; if ((($a = self.expectation_frameworks['$empty?']()) !== nil && (!$a.$$is_boolean || $a == true))) { self.$expect_with("rspec")}; return self.expectation_frameworks; }; def['$expectation_framework='] = function(framework) { var self = this; return self.$expect_with(framework); }; def.$expect_with = TMP_8 = function(frameworks) { var $a, $b, TMP_7, self = this, $iter = TMP_8.$$p, $yield = $iter || nil, modules = nil; frameworks = $slice.call(arguments, 0); TMP_8.$$p = null; modules = ($a = ($b = frameworks).$map, $a.$$p = (TMP_7 = function(framework){var self = TMP_7.$$s || this, $a, $b, $case = nil; if (framework == null) framework = nil; return (function() {$case = framework;if ($scope.get('Module')['$===']($case)) {return framework}else if ("rspec"['$===']($case)) {self.$require("rspec/expectations"); (($a = [true]), $b = self, $b['$expecting_with_rspec='].apply($b, $a), $a[$a.length-1]); return ((Opal.get('RSpec')).$$scope.get('Matchers'));}else if ("stdlib"['$===']($case)) {self.$require("test/unit/assertions"); return ((((Opal.get('Test')).$$scope.get('Unit'))).$$scope.get('Assertions'));}else {return self.$raise($scope.get('ArgumentError'), "" + (framework.$inspect()) + " is not supported")}})()}, TMP_7.$$s = self, TMP_7), $a).call($b); if ((($a = (modules['$-'](self.expectation_frameworks))['$any?']()) !== nil && (!$a.$$is_boolean || $a == true))) { self.$assert_no_example_groups_defined("expect_with")}; if (($yield !== nil)) { if (modules.$length()['$>'](1)) { self.$raise("expect_with only accepts a block with a single argument. Call expect_with " + (modules.$length()) + " times, once with each argument, instead.")}; if ((($a = modules.$first()['$respond_to?']("configuration")) !== nil && (!$a.$$is_boolean || $a == true))) { } else { self.$raise("" + (modules.$first()) + " must respond to `configuration` so that expect_with can yield it.") }; if ($opal.$yield1($yield, modules.$first().$configuration()) === $breaker) return $breaker.$v;}; return ($a = self.expectation_frameworks).$push.apply($a, [].concat(modules)); }; def['$full_backtrace?'] = function() { var self = this; return self.backtrace_formatter['$full_backtrace?'](); }; def['$full_backtrace='] = function(true_or_false) { var $a, $b, self = this; return (($a = [true_or_false]), $b = self.backtrace_formatter, $b['$full_backtrace='].apply($b, $a), $a[$a.length-1]); }; def.$color = function(output) { var $a, self = this; if (output == null) { output = self.$output_stream() } if ((($a = self['$output_to_tty?'](output)) !== nil && (!$a.$$is_boolean || $a == true))) { } else { return false }; return self.$value_for("color", self.color); }; def['$color='] = function(bool) { var $a, $b, self = this; if (bool !== false && bool !== nil) { if ((($a = ($b = $scope.get('RSpec')['$windows_os?'](), $b !== false && $b !== nil ?$scope.get('ENV')['$[]']("ANSICON")['$!']() : $b)) !== nil && (!$a.$$is_boolean || $a == true))) { $scope.get('RSpec').$warning("You must use ANSICON 1.31 or later (http://adoxa.3eeweb.com/ansicon/) to use colour on Windows"); return self.color = false; } else { return self.color = true } } else { return nil }; }; self.$alias_method("color_enabled", "color"); self.$alias_method("color_enabled=", "color="); self.$define_predicate_for("color_enabled", "color"); def['$libs='] = function(libs) { var $a, $b, TMP_9, self = this; return ($a = ($b = libs).$map, $a.$$p = (TMP_9 = function(lib){var self = TMP_9.$$s || this; if (self.libs == null) self.libs = nil; if ($gvars.LOAD_PATH == null) $gvars.LOAD_PATH = nil; if (lib == null) lib = nil; self.libs.$unshift(lib); return $gvars.LOAD_PATH.$unshift(lib);}, TMP_9.$$s = self, TMP_9), $a).call($b); }; def['$requires='] = function(paths) { var $a, $b, TMP_10, self = this; $scope.get('RSpec').$deprecate("RSpec::Core::Configuration#requires=(paths)", $hash2(["replacement"], {"replacement": "paths.each {|path| require path}"})); ($a = ($b = paths).$map, $a.$$p = (TMP_10 = function(path){var self = TMP_10.$$s || this; if (path == null) path = nil; return self.$require(path)}, TMP_10.$$s = self, TMP_10), $a).call($b); return self.requires = self.requires['$+'](paths); }; def['$line_numbers='] = function(line_numbers) { var $a, $b, TMP_11, self = this; return self.$filter_run($hash2(["line_numbers"], {"line_numbers": ($a = ($b = line_numbers).$map, $a.$$p = (TMP_11 = function(l){var self = TMP_11.$$s || this; if (l == null) l = nil; return l.$to_i()}, TMP_11.$$s = self, TMP_11), $a).call($b)})); }; def.$line_numbers = function() { var self = this; return self.$filter().$fetch("line_numbers", []); }; def['$full_description='] = function(description) { var $a, $b, $c, TMP_12, self = this; return self.$filter_run($hash2(["full_description"], {"full_description": ($a = $scope.get('Regexp')).$union.apply($a, [].concat(($b = ($c = self.$Array(description)).$map, $b.$$p = (TMP_12 = function(d){var self = TMP_12.$$s || this; if (d == null) d = nil; return $scope.get('Regexp').$new(d)}, TMP_12.$$s = self, TMP_12), $b).call($c)))})); }; def.$full_description = function() { var self = this; return self.$filter().$fetch("full_description", nil); }; def.$add_formatter = function(formatter_to_use, paths) { var $a, $b, $c, TMP_13, self = this, formatter_class = nil; paths = $slice.call(arguments, 1); formatter_class = ((($a = ((($b = self.$built_in_formatter(formatter_to_use)) !== false && $b !== nil) ? $b : self.$custom_formatter(formatter_to_use))) !== false && $a !== nil) ? $a : (self.$raise($scope.get('ArgumentError'), "Formatter '" + (formatter_to_use) + "' unknown - maybe you meant 'documentation' or 'progress'?."))); if ((($a = paths['$empty?']()) !== nil && (!$a.$$is_boolean || $a == true))) { paths['$<<'](self.$output_stream())}; return self.$formatters()['$<<'](($a = formatter_class).$new.apply($a, [].concat(($b = ($c = paths).$map, $b.$$p = (TMP_13 = function(p){var self = TMP_13.$$s || this, $a; if (p == null) p = nil; if ((($a = $scope.get('String')['$==='](p)) !== nil && (!$a.$$is_boolean || $a == true))) { return self.$file_at(p) } else { return p }}, TMP_13.$$s = self, TMP_13), $b).call($c)))); }; self.$alias_method("formatter=", "add_formatter"); def.$formatters = function() { var $a, self = this; return ((($a = self.formatters) !== false && $a !== nil) ? $a : self.formatters = []); }; def.$reporter = function() { var $a, $b, self = this; return ((($a = self.reporter) !== false && $a !== nil) ? $a : self.reporter = (function() {if ((($b = self.$formatters()['$empty?']()) !== nil && (!$b.$$is_boolean || $b == true))) { self.$add_formatter("progress")}; self.$add_formatter((((((($scope.get('RSpec')).$$scope.get('Core'))).$$scope.get('Formatters'))).$$scope.get('DeprecationFormatter')), self.$deprecation_stream(), self.$output_stream()); return ($b = $scope.get('Reporter')).$new.apply($b, [self].concat(self.$formatters()));})()); }; def.$profile_examples = function() { var $a, $b, self = this, profile = nil; profile = self.$value_for("profile_examples", self.profile_examples); if ((($a = (($b = profile !== false && profile !== nil) ? profile['$is_a?']($scope.get('Integer'))['$!']() : $b)) !== nil && (!$a.$$is_boolean || $a == true))) { return 10 } else { return profile }; }; def['$files_or_directories_to_run='] = function(files) { var $a, $b, $c, $d, self = this; files = $slice.call(arguments, 0); files = files.$flatten(); if ((($a = ($b = ($c = (((($d = self.$command()['$==']("rspec")) !== false && $d !== nil) ? $d : $scope.get('Runner')['$running_in_drb?']())), $c !== false && $c !== nil ?self.$default_path() : $c), $b !== false && $b !== nil ?files['$empty?']() : $b)) !== nil && (!$a.$$is_boolean || $a == true))) { files['$<<'](self.$default_path())}; return (($a = [self.$get_files_to_run(files)]), $b = self, $b['$files_to_run='].apply($b, $a), $a[$a.length-1]); }; def.$alias_example_to = function(new_name, args) { var self = this, extra_options = nil; args = $slice.call(arguments, 1); extra_options = $scope.get('Metadata').$build_hash_from(args); return (((($scope.get('RSpec')).$$scope.get('Core'))).$$scope.get('ExampleGroup')).$alias_example_to(new_name, extra_options); }; def.$alias_it_behaves_like_to = function(new_name, report_label) { var self = this; if (report_label == null) { report_label = "" } return (((($scope.get('RSpec')).$$scope.get('Core'))).$$scope.get('ExampleGroup')).$alias_it_behaves_like_to(new_name, report_label); }; self.$alias_method("alias_it_should_behave_like_to", "alias_it_behaves_like_to"); def.$filter_run_including = function(args) { var self = this; args = $slice.call(arguments, 0); return self.$filter_manager().$include_with_low_priority($scope.get('Metadata').$build_hash_from(args)); }; self.$alias_method("filter_run", "filter_run_including"); def['$inclusion_filter='] = function(filter) { var self = this; return self.$filter_manager()['$include!']($scope.get('Metadata').$build_hash_from([filter])); }; self.$alias_method("filter=", "inclusion_filter="); def.$inclusion_filter = function() { var self = this; return self.$filter_manager().$inclusions(); }; self.$alias_method("filter", "inclusion_filter"); def.$filter_run_excluding = function(args) { var self = this; args = $slice.call(arguments, 0); return self.$filter_manager().$exclude_with_low_priority($scope.get('Metadata').$build_hash_from(args)); }; def['$exclusion_filter='] = function(filter) { var self = this; return self.$filter_manager()['$exclude!']($scope.get('Metadata').$build_hash_from([filter])); }; def.$exclusion_filter = function() { var self = this; return self.$filter_manager().$exclusions(); }; def.$include = function(mod, filters) { var self = this; filters = $slice.call(arguments, 1); return self.$include_or_extend_modules()['$<<'](["include", mod, $scope.get('Metadata').$build_hash_from(filters)]); }; def.$extend = function(mod, filters) { var self = this; filters = $slice.call(arguments, 1); return self.$include_or_extend_modules()['$<<'](["extend", mod, $scope.get('Metadata').$build_hash_from(filters)]); }; def.$configure_group = function(group) { var $a, $b, TMP_14, self = this; return ($a = ($b = self.$include_or_extend_modules()).$each, $a.$$p = (TMP_14 = function(include_or_extend, mod, filters){var self = TMP_14.$$s || this, $a, $b; if (include_or_extend == null) include_or_extend = nil;if (mod == null) mod = nil;if (filters == null) filters = nil; if ((($a = ((($b = filters['$empty?']()) !== false && $b !== nil) ? $b : group['$any_apply?'](filters))) !== nil && (!$a.$$is_boolean || $a == true))) { } else { return nil; }; return self.$send("safe_" + (include_or_extend), mod, group);}, TMP_14.$$s = self, TMP_14), $a).call($b); }; def.$safe_include = function(mod, host) { var self = this; if (host['$<'](mod)) { return nil } else { return host.$send("include", mod) }; }; def.$setup_load_path_and_require = function(paths) { var $a, $b, TMP_15, $c, $d, TMP_16, self = this, directories = nil; directories = ($a = ($b = ["lib", self.$default_path()]).$select, $a.$$p = (TMP_15 = function(p){var self = TMP_15.$$s || this; if (p == null) p = nil; return $scope.get('File')['$directory?'](p)}, TMP_15.$$s = self, TMP_15), $a).call($b); ($a = (((($scope.get('RSpec')).$$scope.get('Core'))).$$scope.get('RubyProject'))).$add_to_load_path.apply($a, [].concat(directories)); ($c = ($d = paths).$each, $c.$$p = (TMP_16 = function(path){var self = TMP_16.$$s || this; if (path == null) path = nil; return self.$require(path)}, TMP_16.$$s = self, TMP_16), $c).call($d); return self.requires = self.requires['$+'](paths); }; if ($scope.get('RUBY_VERSION').$to_f()['$>='](1.9)) { def.$safe_extend = function(mod, host) { var self = this; if (((function(self) { var $scope = self.$$scope, def = self.$$proto; return self })(host.$singleton_class()))['$<'](mod)) { return nil } else { return host.$extend(mod) }; } } else { def.$safe_extend = function(mod, host) { var $a, self = this; if ((($a = ((function(self) { var $scope = self.$$scope, def = self.$$proto; return self })(host.$singleton_class())).$included_modules()['$include?'](mod)) !== nil && (!$a.$$is_boolean || $a == true))) { return nil } else { return host.$extend(mod) }; } }; def.$configure_mock_framework = function() { var self = this; return (((($scope.get('RSpec')).$$scope.get('Core'))).$$scope.get('ExampleGroup')).$send("include", self.$mock_framework()); }; def.$configure_expectation_framework = function() { var $a, $b, TMP_17, self = this; return ($a = ($b = self.$expectation_frameworks()).$each, $a.$$p = (TMP_17 = function(framework){var self = TMP_17.$$s || this; if (framework == null) framework = nil; return (((($scope.get('RSpec')).$$scope.get('Core'))).$$scope.get('ExampleGroup')).$send("include", framework)}, TMP_17.$$s = self, TMP_17), $a).call($b); }; def.$load_spec_files = function() { var $a, $b, TMP_18, self = this; ($a = ($b = self.$files_to_run().$uniq()).$each, $a.$$p = (TMP_18 = function(f){var self = TMP_18.$$s || this; if (f == null) f = nil; return self.$load($scope.get('File').$expand_path(f))}, TMP_18.$$s = self, TMP_18), $a).call($b); return self.spec_files_loaded = true; }; $opal.cdecl($scope, 'DEFAULT_FORMATTER', ($a = ($b = self).$lambda, $a.$$p = (TMP_19 = function(string){var self = TMP_19.$$s || this; if (string == null) string = nil; return string}, TMP_19.$$s = self, TMP_19), $a).call($b)); def.$format_docstrings = TMP_20 = function() { var self = this, $iter = TMP_20.$$p, block = $iter || nil; TMP_20.$$p = null; return self.format_docstrings_block = (function() {if ((block !== nil)) { return block } else { return $scope.get('DEFAULT_FORMATTER') }; return nil; })(); }; def.$format_docstrings_block = function() { var $a, self = this; return ((($a = self.format_docstrings_block) !== false && $a !== nil) ? $a : self.format_docstrings_block = $scope.get('DEFAULT_FORMATTER')); }; $opal.defs(self, '$delegate_to_ordering_manager', function(methods) { var $a, $b, TMP_21, self = this; methods = $slice.call(arguments, 0); return ($a = ($b = methods).$each, $a.$$p = (TMP_21 = function(method){var self = TMP_21.$$s || this, $a, $b, TMP_22; if (method == null) method = nil; return ($a = ($b = self).$define_method, $a.$$p = (TMP_22 = function(args){var self = TMP_22.$$s || this, block, $a, $b; args = $slice.call(arguments, 0); block = TMP_22.$$p || nil, TMP_22.$$p = null; return ($a = ($b = self.$ordering_manager()).$__send__, $a.$$p = block.$to_proc(), $a).apply($b, [method].concat(args))}, TMP_22.$$s = self, TMP_22), $a).call($b, method)}, TMP_21.$$s = self, TMP_21), $a).call($b); }); self.$delegate_to_ordering_manager("seed="); self.$delegate_to_ordering_manager("seed"); self.$delegate_to_ordering_manager("order="); self.$delegate_to_ordering_manager("register_ordering"); self.$delegate_to_ordering_manager("seed_used?", "ordering_registry"); def['$warnings='] = function(value) { var self = this; return $gvars.VERBOSE = value['$!']()['$!'](); }; def.$warnings = function() { var self = this; if ($gvars.VERBOSE == null) $gvars.VERBOSE = nil; return $gvars.VERBOSE; }; def.$expose_current_running_example_as = function(method_name) { var $a, $b, TMP_23, self = this; ($a = ($b = $scope.get('ExposeCurrentExample')).$module_eval, $a.$$p = (TMP_23 = function(){var self = TMP_23.$$s || this, $a, $b, TMP_24; self.$extend((($scope.get('RSpec')).$$scope.get('SharedContext'))); return ($a = ($b = self).$let, $a.$$p = (TMP_24 = function(ex){var self = TMP_24.$$s || this; if (ex == null) ex = nil; return ex}, TMP_24.$$s = self, TMP_24), $a).call($b, method_name);}, TMP_23.$$s = self, TMP_23), $a).call($b); return self.$include($scope.get('ExposeCurrentExample')); }; (function($base) { var self = $module($base, 'ExposeCurrentExample'); var def = self.$$proto, $scope = self.$$scope; nil })(self); def['$raise_errors_for_deprecations!'] = function() { var $a, $b, self = this; return (($a = [(((($scope.get('Formatters')).$$scope.get('DeprecationFormatter'))).$$scope.get('RaiseErrorStream')).$new()]), $b = self, $b['$deprecation_stream='].apply($b, $a), $a[$a.length-1]); }; self.$private(); def.$get_files_to_run = function(paths) { var $a, $b, TMP_25, self = this; return ($a = ($b = $scope.get('FlatMap')).$flat_map, $a.$$p = (TMP_25 = function(path){var self = TMP_25.$$s || this, $a; if (path == null) path = nil; if ((($a = (($scope.get('File')).$$scope.get('ALT_SEPARATOR'))) !== nil && (!$a.$$is_boolean || $a == true))) { path = path.$gsub((($scope.get('File')).$$scope.get('ALT_SEPARATOR')), (($scope.get('File')).$$scope.get('SEPARATOR')))}; if ((($a = $scope.get('File')['$directory?'](path)) !== nil && (!$a.$$is_boolean || $a == true))) { return self.$gather_directories(path) } else { return self.$extract_location(path) };}, TMP_25.$$s = self, TMP_25), $a).call($b, paths).$sort(); }; def.$gather_directories = function(path) { var $a, self = this, stripped = nil, files = nil; stripped = "{" + (self.$pattern().$gsub(/\s*,\s*/, ",")) + "}"; files = (function() {if ((($a = self.$pattern()['$=~']((new RegExp("^" + $scope.get('Regexp').$escape(path))))) !== nil && (!$a.$$is_boolean || $a == true))) { return $scope.get('Dir')['$[]'](stripped) } else { return $scope.get('Dir')['$[]']("" + (path) + "/" + (stripped)) }; return nil; })(); return files.$sort(); }; def.$extract_location = function(path) { var $a, $b, $c, TMP_26, self = this, lines = nil; if ((($a = path['$=~'](/^(.*?)((?:\:\d+)+)$/)) !== nil && (!$a.$$is_boolean || $a == true))) { $a = [nil, ($b = ($c = nil['$[]']($range(1, -1, false)).$split(":")).$map, $b.$$p = (TMP_26 = function(n){var self = TMP_26.$$s || this; if (n == null) n = nil; return n.$to_i()}, TMP_26.$$s = self, TMP_26), $b).call($c)], path = $a[0], lines = $a[1]; self.$filter_manager().$add_location(path, lines);}; return path; }; def.$command = function() { var self = this; if ($gvars["0"] == null) $gvars["0"] = nil; return $gvars["0"].$split((($scope.get('File')).$$scope.get('SEPARATOR'))).$last(); }; def.$value_for = function(key, default$) { var $a, self = this; if (default$ == null) { default$ = nil } if ((($a = self.preferred_options['$has_key?'](key)) !== nil && (!$a.$$is_boolean || $a == true))) { return self.preferred_options['$[]'](key) } else { return default$ }; }; def.$assert_no_example_groups_defined = function(config_option) { var $a, self = this; if ((($a = $scope.get('RSpec').$world().$example_groups()['$any?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return self.$raise($scope.get('MustBeConfiguredBeforeExampleGroupsError').$new(((("RSpec's ") + (config_option)) + " configuration option must be configured before ")['$+']("any example groups are defined, but you have already defined a group."))) } else { return nil }; }; def['$output_to_tty?'] = function(output) { var $a, $b, self = this; if (output == null) { output = self.$output_stream() } return ((($a = self['$tty?']()) !== false && $a !== nil) ? $a : (($b = output['$respond_to?']("tty?"), $b !== false && $b !== nil ?output['$tty?']() : $b))); }; def.$built_in_formatter = function(key) { var self = this, $case = nil; return (function() {$case = key.$to_s();if ("d"['$===']($case) || "doc"['$===']($case) || "documentation"['$===']($case) || "s"['$===']($case) || "n"['$===']($case) || "spec"['$===']($case) || "nested"['$===']($case)) {self.$require("rspec/core/formatters/documentation_formatter"); return (((((($scope.get('RSpec')).$$scope.get('Core'))).$$scope.get('Formatters'))).$$scope.get('DocumentationFormatter'));}else if ("h"['$===']($case) || "html"['$===']($case)) {self.$require("rspec/core/formatters/html_formatter"); return (((((($scope.get('RSpec')).$$scope.get('Core'))).$$scope.get('Formatters'))).$$scope.get('HtmlFormatter'));}else if ("p"['$===']($case) || "progress"['$===']($case)) {self.$require("rspec/core/formatters/progress_formatter"); return (((((($scope.get('RSpec')).$$scope.get('Core'))).$$scope.get('Formatters'))).$$scope.get('ProgressFormatter'));}else if ("j"['$===']($case) || "json"['$===']($case)) {self.$require("rspec/core/formatters/json_formatter"); return (((((($scope.get('RSpec')).$$scope.get('Core'))).$$scope.get('Formatters'))).$$scope.get('JsonFormatter'));}else { return nil }})(); }; def.$custom_formatter = function(formatter_ref) { var $a, $b, TMP_27, self = this; if ((($a = $scope.get('Class')['$==='](formatter_ref)) !== nil && (!$a.$$is_boolean || $a == true))) { return formatter_ref } else if ((($a = self['$string_const?'](formatter_ref)) !== nil && (!$a.$$is_boolean || $a == true))) { try { return ($a = ($b = formatter_ref.$gsub(/^::/, "").$split("::")).$inject, $a.$$p = (TMP_27 = function(const$, string){var self = TMP_27.$$s || this; if (const$ == null) const$ = nil;if (string == null) string = nil; return const$.$const_get(string)}, TMP_27.$$s = self, TMP_27), $a).call($b, $scope.get('Object')) } catch ($err) {if ($opal.$rescue($err, [$scope.get('NameError')])) { if ((($a = self.$require(self.$path_for(formatter_ref))) !== nil && (!$a.$$is_boolean || $a == true))) { return self.$retry() } else { return self.$raise() } }else { throw $err; } } } else { return nil }; }; def['$string_const?'] = function(str) { var $a, self = this; return ($a = str['$is_a?']($scope.get('String')), $a !== false && $a !== nil ?/\A[A-Z][a-zA-Z0-9_:]*\z/['$=~'](str) : $a); }; def.$path_for = function(const_ref) { var self = this; return self.$underscore_with_fix_for_non_standard_rspec_naming(const_ref); }; def.$underscore_with_fix_for_non_standard_rspec_naming = function(string) { var self = this; return self.$underscore(string).$sub(/(^|\/)r_spec($|\/)/, "\\1rspec\\2"); }; def.$underscore = function(camel_cased_word) { var self = this, word = nil; word = camel_cased_word.$to_s().$dup(); word['$gsub!'](/::/, "/"); word['$gsub!'](/([A-Z]+)([A-Z][a-z])/, "\\1_\\2"); word['$gsub!'](/([a-z\d])([A-Z])/, "\\1_\\2"); word['$tr!']("-", "_"); word['$downcase!'](); return word; }; return (def.$file_at = function(path) { var self = this; $scope.get('FileUtils').$mkdir_p($scope.get('File').$dirname(path)); return $scope.get('File').$new(path, "w"); }, nil) && 'file_at'; })(self, null) })(self) })(self); }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/core/configuration_options"] = function($opal) { $opal.dynamic_require_severity = "warning"; var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass, $hash = $opal.hash, $hash2 = $opal.hash2; $opal.add_stubs(['$require', '$attr_reader', '$map', '$sub', '$filter_manager=', '$filter_manager', '$libs=', '$[]', '$options', '$setup_load_path_and_require', '$process_options_into', '$load_formatters_into', '$inject', '$merge', '$include?', '$+', '$each', '$has_key?', '$include', '$delete', '$exclude', '$<<', '$file_options', '$command_line_options', '$env_options', '$new', '$configuration', '$private', '$to_set', '$!', '$unshift', '$reverse', '$reject', '$force?', '$force', '$send', '$order', '$keys', '$add_formatter', '$custom_options_file', '$custom_options', '$global_options', '$project_options', '$local_options', '$parse!', '$split', '$options_from', '$local_options_file', '$project_options_file', '$global_options_file', '$parse', '$args_from_options_file', '$exist?', '$options_file_as_erb_string', '$flat_map', '$to_proc', '$result', '$read', '$binding', '$join', '$expand_path', '$warning']); self.$require("erb"); self.$require("shellwords"); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Core'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $ConfigurationOptions(){}; var self = $ConfigurationOptions = $klass($base, $super, 'ConfigurationOptions', $ConfigurationOptions); var def = self.$$proto, $scope = self.$$scope; def.filter_manager = def.command_line_options = def.args = def.local_options = def.project_options = def.global_options = nil; self.$attr_reader("options"); def.$initialize = function(args) { var $a, $b, TMP_1, self = this; return self.args = ($a = ($b = args).$map, $a.$$p = (TMP_1 = function(a){var self = TMP_1.$$s || this; if (a == null) a = nil; return a.$sub("default_path", "default-path").$sub("line_number", "line-number")}, TMP_1.$$s = self, TMP_1), $a).call($b); }; def.$configure = function(config) { var $a, $b, $c, self = this; (($a = [self.$filter_manager()]), $b = config, $b['$filter_manager='].apply($b, $a), $a[$a.length-1]); (($a = [((($c = self.$options()['$[]']("libs")) !== false && $c !== nil) ? $c : [])]), $b = config, $b['$libs='].apply($b, $a), $a[$a.length-1]); config.$setup_load_path_and_require(((($a = self.$options()['$[]']("requires")) !== false && $a !== nil) ? $a : [])); self.$process_options_into(config); return self.$load_formatters_into(config); }; def.$parse_options = function() { var $a, $b, TMP_2, $c, $d, TMP_4, self = this; return self.options = ($a = ($b = ($c = ($d = (self.$file_options()['$<<'](self.$command_line_options())['$<<'](self.$env_options()))).$each, $c.$$p = (TMP_4 = function(opts){var self = TMP_4.$$s || this, $a; if (opts == null) opts = nil; if ((($a = opts['$has_key?']("inclusion_filter")) !== nil && (!$a.$$is_boolean || $a == true))) { self.$filter_manager().$include(opts.$delete("inclusion_filter"))}; if ((($a = opts['$has_key?']("exclusion_filter")) !== nil && (!$a.$$is_boolean || $a == true))) { return self.$filter_manager().$exclude(opts.$delete("exclusion_filter")) } else { return nil };}, TMP_4.$$s = self, TMP_4), $c).call($d)).$inject, $a.$$p = (TMP_2 = function(h, opts){var self = TMP_2.$$s || this, $a, $b, TMP_3; if (h == null) h = nil;if (opts == null) opts = nil; return ($a = ($b = h).$merge, $a.$$p = (TMP_3 = function(k, oldval, newval){var self = TMP_3.$$s || this, $a; if (k == null) k = nil;if (oldval == null) oldval = nil;if (newval == null) newval = nil; if ((($a = ["libs", "requires"]['$include?'](k)) !== nil && (!$a.$$is_boolean || $a == true))) { return oldval['$+'](newval) } else { return newval }}, TMP_3.$$s = self, TMP_3), $a).call($b, opts)}, TMP_2.$$s = self, TMP_2), $a).call($b); }; def.$drb_argv = function() { var self = this; return $scope.get('DrbOptions').$new(self.$options(), self.$filter_manager()).$options(); }; def.$filter_manager = function() { var $a, self = this; return ((($a = self.filter_manager) !== false && $a !== nil) ? $a : self.filter_manager = $scope.get('RSpec').$configuration().$filter_manager()); }; self.$private(); $opal.cdecl($scope, 'UNFORCED_OPTIONS', ["requires", "profile", "drb", "libs", "files_or_directories_to_run", "line_numbers", "full_description", "full_backtrace", "tty"].$to_set()); $opal.cdecl($scope, 'UNPROCESSABLE_OPTIONS', ["libs", "formatters", "requires"].$to_set()); def['$force?'] = function(key) { var self = this; return $scope.get('UNFORCED_OPTIONS')['$include?'](key)['$!'](); }; def.$order = function(keys, ordered) { var $a, $b, TMP_5, self = this; ordered = $slice.call(arguments, 1); ($a = ($b = ordered.$reverse()).$each, $a.$$p = (TMP_5 = function(key){var self = TMP_5.$$s || this, $a; if (key == null) key = nil; if ((($a = keys.$delete(key)) !== nil && (!$a.$$is_boolean || $a == true))) { return keys.$unshift(key) } else { return nil }}, TMP_5.$$s = self, TMP_5), $a).call($b); return keys; }; def.$process_options_into = function(config) { var $a, $b, TMP_6, $c, TMP_7, self = this, opts = nil; opts = ($a = ($b = self.$options()).$reject, $a.$$p = (TMP_6 = function(k, _){var self = TMP_6.$$s || this; if (k == null) k = nil;if (_ == null) _ = nil; return $scope.get('UNPROCESSABLE_OPTIONS')['$include?'](k)}, TMP_6.$$s = self, TMP_6), $a).call($b); return ($a = ($c = self.$order(opts.$keys(), "default_path", "pattern")).$each, $a.$$p = (TMP_7 = function(key){var self = TMP_7.$$s || this, $a; if (key == null) key = nil; if ((($a = self['$force?'](key)) !== nil && (!$a.$$is_boolean || $a == true))) { return config.$force($hash(key, opts['$[]'](key))) } else { return config.$send("" + (key) + "=", opts['$[]'](key)) }}, TMP_7.$$s = self, TMP_7), $a).call($c); }; def.$load_formatters_into = function(config) { var $a, $b, TMP_8, self = this; if ((($a = self.$options()['$[]']("formatters")) !== nil && (!$a.$$is_boolean || $a == true))) { return ($a = ($b = self.$options()['$[]']("formatters")).$each, $a.$$p = (TMP_8 = function(pair){var self = TMP_8.$$s || this, $a; if (pair == null) pair = nil; return ($a = config).$add_formatter.apply($a, [].concat(pair))}, TMP_8.$$s = self, TMP_8), $a).call($b) } else { return nil }; }; def.$file_options = function() { var $a, self = this; if ((($a = self.$custom_options_file()) !== nil && (!$a.$$is_boolean || $a == true))) { return [self.$custom_options()] } else { return [self.$global_options(), self.$project_options(), self.$local_options()] }; }; def.$env_options = function() { var $a, self = this; if ((($a = $scope.get('ENV')['$[]']("SPEC_OPTS")) !== nil && (!$a.$$is_boolean || $a == true))) { return $scope.get('Parser')['$parse!']($scope.get('Shellwords').$split($scope.get('ENV')['$[]']("SPEC_OPTS"))) } else { return $hash2([], {}) }; }; def.$command_line_options = function() { var $a, self = this; return ((($a = self.command_line_options) !== false && $a !== nil) ? $a : self.command_line_options = $scope.get('Parser')['$parse!'](self.args).$merge($hash2(["files_or_directories_to_run"], {"files_or_directories_to_run": self.args}))); }; def.$custom_options = function() { var self = this; return self.$options_from(self.$custom_options_file()); }; def.$local_options = function() { var $a, self = this; return ((($a = self.local_options) !== false && $a !== nil) ? $a : self.local_options = self.$options_from(self.$local_options_file())); }; def.$project_options = function() { var $a, self = this; return ((($a = self.project_options) !== false && $a !== nil) ? $a : self.project_options = self.$options_from(self.$project_options_file())); }; def.$global_options = function() { var $a, self = this; return ((($a = self.global_options) !== false && $a !== nil) ? $a : self.global_options = self.$options_from(self.$global_options_file())); }; def.$options_from = function(path) { var self = this; return $scope.get('Parser').$parse(self.$args_from_options_file(path)); }; def.$args_from_options_file = function(path) { var $a, $b, self = this, config_string = nil; if ((($a = (($b = path !== false && path !== nil) ? $scope.get('File')['$exist?'](path) : $b)) !== nil && (!$a.$$is_boolean || $a == true))) { } else { return [] }; config_string = self.$options_file_as_erb_string(path); return ($a = ($b = $scope.get('FlatMap')).$flat_map, $a.$$p = "shellsplit".$to_proc(), $a).call($b, config_string.$split(/\n+/)); }; def.$options_file_as_erb_string = function(path) { var self = this; return $scope.get('ERB').$new($scope.get('File').$read(path), nil, "-").$result(self.$binding()); }; def.$custom_options_file = function() { var self = this; return self.$command_line_options()['$[]']("custom_options_file"); }; def.$project_options_file = function() { var self = this; return ".rspec"; }; def.$local_options_file = function() { var self = this; return ".rspec-local"; }; return (def.$global_options_file = function() { var self = this; try { return $scope.get('File').$join($scope.get('File').$expand_path("~"), ".rspec") } catch ($err) {if ($opal.$rescue($err, [$scope.get('ArgumentError')])) { $scope.get('RSpec').$warning("Unable to find ~/.rspec because the HOME environment variable is not set"); return nil; }else { throw $err; } }; }, nil) && 'global_options_file'; })(self, null) })(self) })(self); }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/core/drb_command_line"] = function($opal) { $opal.dynamic_require_severity = "warning"; var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass; $opal.add_stubs(['$require', '$[]', '$options', '$start_service', '$new_with_uri', '$drb_port', '$run', '$drb_argv']); self.$require("drb/drb"); self.$require("rspec/core/drb_options"); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Core'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $DRbCommandLine(){}; var self = $DRbCommandLine = $klass($base, $super, 'DRbCommandLine', $DRbCommandLine); var def = self.$$proto, $scope = self.$$scope; def.options = nil; def.$initialize = function(options) { var self = this; return self.options = options; }; def.$drb_port = function() { var $a, $b, self = this; return ((($a = ((($b = self.options.$options()['$[]']("drb_port")) !== false && $b !== nil) ? $b : $scope.get('ENV')['$[]']("RSPEC_DRB"))) !== false && $a !== nil) ? $a : 8989); }; return (def.$run = function(err, out) { var self = this, spec_server = nil; try { $scope.get('DRb').$start_service("druby://localhost:0") } catch ($err) {if ($opal.$rescue($err, [$scope.get('SocketError'), (($scope.get('Errno')).$$scope.get('EADDRNOTAVAIL'))])) { $scope.get('DRb').$start_service("druby://:0") }else { throw $err; } }; spec_server = $scope.get('DRbObject').$new_with_uri("druby://127.0.0.1:" + (self.$drb_port())); return spec_server.$run(self.options.$drb_argv(), err, out); }, nil) && 'run'; })(self, null) })(self) })(self); }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/core/drb_options"] = function($opal) { $opal.dynamic_require_severity = "warning"; var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass; $opal.add_stubs(['$[]', '$<<', '$add_failure_exit_code', '$add_full_description', '$add_line_numbers', '$add_filter', '$inclusions', '$exclusions', '$add_formatters', '$add_libs', '$add_requires', '$+', '$to_s', '$each', '$delete', '$source', '$push', '$inject', '$empty?', '$each_pair', '$include?', '$==', '$is_a?']); return (function($base) { var self = $module($base, 'Core'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $DrbOptions(){}; var self = $DrbOptions = $klass($base, $super, 'DrbOptions', $DrbOptions); var def = self.$$proto, $scope = self.$$scope; def.submitted_options = def.filter_manager = nil; def.$initialize = function(submitted_options, filter_manager) { var self = this; self.submitted_options = submitted_options; return self.filter_manager = filter_manager; }; def.$options = function() { var $a, self = this, argv = nil; argv = []; if ((($a = self.submitted_options['$[]']("color")) !== nil && (!$a.$$is_boolean || $a == true))) { argv['$<<']("--color")}; if ((($a = self.submitted_options['$[]']("profile_examples")) !== nil && (!$a.$$is_boolean || $a == true))) { argv['$<<']("--profile")}; if ((($a = self.submitted_options['$[]']("full_backtrace")) !== nil && (!$a.$$is_boolean || $a == true))) { argv['$<<']("--backtrace")}; if ((($a = self.submitted_options['$[]']("tty")) !== nil && (!$a.$$is_boolean || $a == true))) { argv['$<<']("--tty")}; if ((($a = self.submitted_options['$[]']("fail_fast")) !== nil && (!$a.$$is_boolean || $a == true))) { argv['$<<']("--fail-fast")}; if ((($a = self.submitted_options['$[]']("custom_options_file")) !== nil && (!$a.$$is_boolean || $a == true))) { argv['$<<']("--options")['$<<'](self.submitted_options['$[]']("custom_options_file"))}; if ((($a = self.submitted_options['$[]']("order")) !== nil && (!$a.$$is_boolean || $a == true))) { argv['$<<']("--order")['$<<'](self.submitted_options['$[]']("order"))}; self.$add_failure_exit_code(argv); self.$add_full_description(argv); self.$add_line_numbers(argv); self.$add_filter(argv, "inclusion", self.filter_manager.$inclusions()); self.$add_filter(argv, "exclusion", self.filter_manager.$exclusions()); self.$add_formatters(argv); self.$add_libs(argv); self.$add_requires(argv); return argv['$+'](self.submitted_options['$[]']("files_or_directories_to_run")); }; def.$add_failure_exit_code = function(argv) { var $a, self = this; if ((($a = self.submitted_options['$[]']("failure_exit_code")) !== nil && (!$a.$$is_boolean || $a == true))) { return argv['$<<']("--failure-exit-code")['$<<'](self.submitted_options['$[]']("failure_exit_code").$to_s()) } else { return nil }; }; def.$add_full_description = function(argv) { var $a, $b, TMP_1, self = this; if ((($a = self.submitted_options['$[]']("full_description")) !== nil && (!$a.$$is_boolean || $a == true))) { return ($a = ($b = self.submitted_options['$[]']("full_description")).$each, $a.$$p = (TMP_1 = function(description){var self = TMP_1.$$s || this; if (description == null) description = nil; return argv['$<<']("--example")['$<<'](description.$source().$delete("\\"))}, TMP_1.$$s = self, TMP_1), $a).call($b) } else { return nil }; }; def.$add_line_numbers = function(argv) { var $a, $b, $c, TMP_2, self = this; if ((($a = self.submitted_options['$[]']("line_numbers")) !== nil && (!$a.$$is_boolean || $a == true))) { return ($a = argv).$push.apply($a, [].concat(($b = ($c = self.submitted_options['$[]']("line_numbers")).$inject, $b.$$p = (TMP_2 = function(a, l){var self = TMP_2.$$s || this; if (a == null) a = nil;if (l == null) l = nil; return a['$<<']("--line_number")['$<<'](l)}, TMP_2.$$s = self, TMP_2), $b).call($c, []))) } else { return nil }; }; $opal.cdecl($scope, 'CONDITIONAL_FILTERS', ["if", "unless"]); def.$add_filter = function(argv, name, hash) { var $a, $b, TMP_3, self = this; if ((($a = hash['$empty?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return nil } else { return ($a = ($b = hash).$each_pair, $a.$$p = (TMP_3 = function(k, v){var self = TMP_3.$$s || this, $a, tag = nil; if (k == null) k = nil;if (v == null) v = nil; if ((($a = $scope.get('CONDITIONAL_FILTERS')['$include?'](k)) !== nil && (!$a.$$is_boolean || $a == true))) { return nil;}; tag = (function() {if (name['$==']("inclusion")) { return k.$to_s() } else { return "~" + (k) }; return nil; })(); if ((($a = v['$is_a?']($scope.get('String'))) !== nil && (!$a.$$is_boolean || $a == true))) { tag['$<<'](":" + (v))}; return argv['$<<']("--tag")['$<<'](tag);}, TMP_3.$$s = self, TMP_3), $a).call($b) }; }; def.$add_formatters = function(argv) { var $a, $b, TMP_4, self = this; if ((($a = self.submitted_options['$[]']("formatters")) !== nil && (!$a.$$is_boolean || $a == true))) { return ($a = ($b = self.submitted_options['$[]']("formatters")).$each, $a.$$p = (TMP_4 = function(pair){var self = TMP_4.$$s || this, $a; if (pair == null) pair = nil; argv['$<<']("--format")['$<<'](pair['$[]'](0)); if ((($a = pair['$[]'](1)) !== nil && (!$a.$$is_boolean || $a == true))) { return argv['$<<']("--out")['$<<'](pair['$[]'](1)) } else { return nil };}, TMP_4.$$s = self, TMP_4), $a).call($b) } else { return nil }; }; def.$add_libs = function(argv) { var $a, $b, TMP_5, self = this; if ((($a = self.submitted_options['$[]']("libs")) !== nil && (!$a.$$is_boolean || $a == true))) { return ($a = ($b = self.submitted_options['$[]']("libs")).$each, $a.$$p = (TMP_5 = function(path){var self = TMP_5.$$s || this; if (path == null) path = nil; return argv['$<<']("-I")['$<<'](path)}, TMP_5.$$s = self, TMP_5), $a).call($b) } else { return nil }; }; return (def.$add_requires = function(argv) { var $a, $b, TMP_6, self = this; if ((($a = self.submitted_options['$[]']("requires")) !== nil && (!$a.$$is_boolean || $a == true))) { return ($a = ($b = self.submitted_options['$[]']("requires")).$each, $a.$$p = (TMP_6 = function(path){var self = TMP_6.$$s || this; if (path == null) path = nil; return argv['$<<']("--require")['$<<'](path)}, TMP_6.$$s = self, TMP_6), $a).call($b) } else { return nil }; }, nil) && 'add_requires'; })(self, null) })($scope.get('RSpec')) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/core/dsl"] = function($opal) { $opal.dynamic_require_severity = "warning"; var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module; $opal.add_stubs(['$register', '$describe', '$to_proc', '$extend', '$send']); (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Core'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'DSL'); var def = self.$$proto, $scope = self.$$scope, TMP_1; def.$describe = TMP_1 = function(args) { var $a, $b, self = this, $iter = TMP_1.$$p, example_group_block = $iter || nil; args = $slice.call(arguments, 0); TMP_1.$$p = null; return ($a = ($b = (((($scope.get('RSpec')).$$scope.get('Core'))).$$scope.get('ExampleGroup'))).$describe, $a.$$p = example_group_block.$to_proc(), $a).apply($b, [].concat(args)).$register(); } ;$opal.donate(self, ["$describe"]); })(self) })(self) })(self); self.$extend((((($scope.get('RSpec')).$$scope.get('Core'))).$$scope.get('DSL'))); return $scope.get('Module').$send("include", (((($scope.get('RSpec')).$$scope.get('Core'))).$$scope.get('DSL'))); }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/core/example"] = function($opal) { $opal.dynamic_require_severity = "warning"; var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass, $hash2 = $opal.hash2; $opal.add_stubs(['$each', '$define_method', '$[]', '$delegate_to_metadata', '$empty?', '$to_s', '$metadata', '$location', '$call', '$format_docstrings_block', '$configuration', '$attr_reader', '$for_example', '$alias_method', '$current_example=', '$start', '$pending', '$dry_run?', '$with_around_each_hooks', '$run_before_each', '$instance_exec', '$to_proc', '$message', '$set_exception', '$run_after_each', '$instance_variable_set', '$instance_variables', '$assign_generated_description', '$finish', '$__send__', '$public_instance_methods', '$new', '$class', '$any_apply?', '$all_apply?', '$around_each_hooks_for', '$example_group', '$!', '$==', '$first', '$backtrace', '$reporter', '$instance_exec_with_rescue', '$private', '$around_each_hooks', '$run_around_each_hooks', '$example_started', '$record', '$now', '$record_finished', '$example_failed', '$example_pending', '$===', '$example_passed', '$merge', '$to_f', '$-', '$execution_result', '$setup_mocks_for_rspec', '$run_before_each_hooks', '$run_after_each_hooks', '$verify_mocks', '$teardown_mocks_for_rspec', '$verify_mocks_for_rspec', '$expecting_with_rspec?', '$pending?', '$<<', '$generated_description', '$clear_generated_description', '$update']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Core'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Example(){}; var self = $Example = $klass($base, $super, 'Example', $Example); var def = self.$$proto, $scope = self.$$scope, TMP_9, TMP_10, TMP_11; def.example_group_class = def.options = def.example_group_instance = def.metadata = def.around_each_hooks = def.exception = def.pending_declared_in_example = nil; $opal.defs(self, '$delegate_to_metadata', function(keys) { var $a, $b, TMP_1, self = this; keys = $slice.call(arguments, 0); return ($a = ($b = keys).$each, $a.$$p = (TMP_1 = function(key){var self = TMP_1.$$s || this, $a, $b, TMP_2; if (key == null) key = nil; return ($a = ($b = self).$define_method, $a.$$p = (TMP_2 = function(){var self = TMP_2.$$s || this; if (self.metadata == null) self.metadata = nil; return self.metadata['$[]'](key)}, TMP_2.$$s = self, TMP_2), $a).call($b, key)}, TMP_1.$$s = self, TMP_1), $a).call($b); }); self.$delegate_to_metadata("full_description", "execution_result", "file_path", "pending", "location"); def.$description = function() { var $a, self = this, description = nil; description = (function() {if ((($a = self.$metadata()['$[]']("description").$to_s()['$empty?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return "example at " + (self.$location()) } else { return self.$metadata()['$[]']("description") }; return nil; })(); return $scope.get('RSpec').$configuration().$format_docstrings_block().$call(description); }; self.$attr_reader("exception"); self.$attr_reader("metadata"); self.$attr_reader("example_group_instance"); def.$initialize = function(example_group_class, description, metadata, example_block) { var $a, self = this; if (example_block == null) { example_block = nil } $a = [example_group_class, metadata, example_block], self.example_group_class = $a[0], self.options = $a[1], self.example_block = $a[2]; self.metadata = self.example_group_class.$metadata().$for_example(description, metadata); self.example_group_instance = self.exception = nil; return self.pending_declared_in_example = false; }; def.$options = function() { var self = this; return self.options; }; def.$example_group = function() { var self = this; return self.example_group_class; }; self.$alias_method("pending?", "pending"); def.$run = function(example_group_instance, reporter) { var $a, $b, TMP_3, $c, TMP_4, $d, self = this, e = nil; try { self.example_group_instance = example_group_instance; (($a = [self]), $b = $scope.get('RSpec'), $b['$current_example='].apply($b, $a), $a[$a.length-1]); self.$start(reporter); try { try { if ((($a = ((($b = self.$pending()) !== false && $b !== nil) ? $b : $scope.get('RSpec').$configuration()['$dry_run?']())) !== nil && (!$a.$$is_boolean || $a == true))) { } else { ($a = ($b = self).$with_around_each_hooks, $a.$$p = (TMP_3 = function(){var self = TMP_3.$$s || this, $a, $b, e = nil; if (self.example_block == null) self.example_block = nil; if (self.example_group_instance == null) self.example_group_instance = nil; try { try { self.$run_before_each(); return ($a = ($b = self.example_group_instance).$instance_exec, $a.$$p = self.example_block.$to_proc(), $a).call($b, self); } catch ($err) {if ($opal.$rescue($err, [(($scope.get('Pending')).$$scope.get('PendingDeclaredInExample'))])) {e = $err; return self.pending_declared_in_example = e.$message() }else if ($opal.$rescue($err, [$scope.get('Exception')])) {e = $err; self.$set_exception(e) }else { throw $err; } } } finally { self.$run_after_each() }}, TMP_3.$$s = self, TMP_3), $a).call($b) } } catch ($err) {if ($opal.$rescue($err, [$scope.get('Exception')])) {e = $err; self.$set_exception(e) }else { throw $err; } } } finally { ($a = ($c = self.example_group_instance.$instance_variables()).$each, $a.$$p = (TMP_4 = function(ivar){var self = TMP_4.$$s || this; if (self.example_group_instance == null) self.example_group_instance = nil; if (ivar == null) ivar = nil; return self.example_group_instance.$instance_variable_set(ivar, nil)}, TMP_4.$$s = self, TMP_4), $a).call($c); self.example_group_instance = nil; try { self.$assign_generated_description() } catch ($err) {if ($opal.$rescue($err, [$scope.get('Exception')])) {e = $err; self.$set_exception(e, "while assigning the example description") }else { throw $err; } }; }; return self.$finish(reporter); } finally { (($a = [nil]), $d = $scope.get('RSpec'), $d['$current_example='].apply($d, $a), $a[$a.length-1]) }; }; (function($base, $super) { function $Procsy(){}; var self = $Procsy = $klass($base, $super, 'Procsy', $Procsy); var def = self.$$proto, $scope = self.$$scope, $a, $b, TMP_5, TMP_7, TMP_8; self.$attr_reader("metadata"); ($a = ($b = $scope.get('Proc').$public_instance_methods(false)).$each, $a.$$p = (TMP_5 = function(name){var self = TMP_5.$$s || this, $a, $b, TMP_6; if (name == null) name = nil; return ($a = ($b = self).$define_method, $a.$$p = (TMP_6 = function(a){var self = TMP_6.$$s || this, b, $a, $b; if (self.proc == null) self.proc = nil; a = $slice.call(arguments, 0); b = TMP_6.$$p || nil, TMP_6.$$p = null; return ($a = ($b = self.proc).$__send__, $a.$$p = b.$to_proc(), $a).apply($b, [name].concat(a))}, TMP_6.$$s = self, TMP_6), $a).call($b, name)}, TMP_5.$$s = self, TMP_5), $a).call($b); $opal.defn(self, '$run', def.$call); def.$initialize = TMP_7 = function(metadata) { var self = this, $iter = TMP_7.$$p, block = $iter || nil; TMP_7.$$p = null; self.metadata = metadata; return self.proc = block; }; return (def.$wrap = TMP_8 = function() { var $a, $b, self = this, $iter = TMP_8.$$p, block = $iter || nil; TMP_8.$$p = null; return ($a = ($b = self.$class()).$new, $a.$$p = block.$to_proc(), $a).call($b, self.$metadata()); }, nil) && 'wrap'; })(self, null); def['$any_apply?'] = function(filters) { var self = this; return self.$metadata()['$any_apply?'](filters); }; def['$all_apply?'] = function(filters) { var $a, self = this; return ((($a = self.metadata['$all_apply?'](filters)) !== false && $a !== nil) ? $a : self.example_group_class['$all_apply?'](filters)); }; def.$around_each_hooks = function() { var $a, self = this; return ((($a = self.around_each_hooks) !== false && $a !== nil) ? $a : self.around_each_hooks = self.$example_group().$around_each_hooks_for(self)); }; def.$set_exception = function(exception, context) { var $a, $b, self = this, msg = nil; if (context == null) { context = nil } if ((($a = ($b = self.exception, $b !== false && $b !== nil ?context['$==']("dont_print")['$!']() : $b)) !== nil && (!$a.$$is_boolean || $a == true))) { msg = "\nAn error occurred " + (context) + "\n " + (exception.$class()) + ": " + (exception.$message()) + "\n occurred at " + (exception.$backtrace().$first()) + "\n\n"; $scope.get('RSpec').$configuration().$reporter().$message(msg);}; return ((($a = self.exception) !== false && $a !== nil) ? $a : self.exception = exception); }; def.$fail_with_exception = function(reporter, exception) { var self = this; self.$start(reporter); self.$set_exception(exception); return self.$finish(reporter); }; def.$instance_exec_with_rescue = TMP_9 = function(context) { var $a, $b, self = this, $iter = TMP_9.$$p, block = $iter || nil; if (context == null) { context = nil } TMP_9.$$p = null; return ($a = ($b = self.example_group_instance).$instance_exec_with_rescue, $a.$$p = block.$to_proc(), $a).call($b, self, context); }; def.$instance_exec = TMP_10 = function(args) { var $a, $b, self = this, $iter = TMP_10.$$p, block = $iter || nil; args = $slice.call(arguments, 0); TMP_10.$$p = null; return ($a = ($b = self.example_group_instance).$instance_exec, $a.$$p = block.$to_proc(), $a).apply($b, [].concat(args)); }; self.$private(); def.$with_around_each_hooks = TMP_11 = function() { var $a, $b, self = this, $iter = TMP_11.$$p, block = $iter || nil, e = nil; TMP_11.$$p = null; try { if ((($a = self.$around_each_hooks()['$empty?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return $a = $opal.$yieldX(block, []), $a === $breaker ? $a : $a } else { return self.example_group_class.$run_around_each_hooks(self, ($a = ($b = $scope.get('Procsy')).$new, $a.$$p = block.$to_proc(), $a).call($b, self.$metadata())) } } catch ($err) {if ($opal.$rescue($err, [$scope.get('Exception')])) {e = $err; return self.$set_exception(e, "in an around(:each) hook") }else { throw $err; } }; }; def.$start = function(reporter) { var self = this; reporter.$example_started(self); return self.$record($hash2(["started_at"], {"started_at": (((($scope.get('RSpec')).$$scope.get('Core'))).$$scope.get('Time')).$now()})); }; def.$finish = function(reporter) { var $a, self = this; if ((($a = self.exception) !== nil && (!$a.$$is_boolean || $a == true))) { self.$record_finished("failed", $hash2(["exception"], {"exception": self.exception})); reporter.$example_failed(self); return false; } else if ((($a = self.pending_declared_in_example) !== nil && (!$a.$$is_boolean || $a == true))) { self.$record_finished("pending", $hash2(["pending_message"], {"pending_message": self.pending_declared_in_example})); reporter.$example_pending(self); return true; } else if ((($a = self.$pending()) !== nil && (!$a.$$is_boolean || $a == true))) { self.$record_finished("pending", $hash2(["pending_message"], {"pending_message": (function() {if ((($a = $scope.get('String')['$==='](self.$pending())) !== nil && (!$a.$$is_boolean || $a == true))) { return self.$pending() } else { return (($scope.get('Pending')).$$scope.get('NO_REASON_GIVEN')) }; return nil; })()})); reporter.$example_pending(self); return true; } else { self.$record_finished("passed"); reporter.$example_passed(self); return true; }; }; def.$record_finished = function(status, results) { var self = this, finished_at = nil; if (results == null) { results = $hash2([], {}) } finished_at = (((($scope.get('RSpec')).$$scope.get('Core'))).$$scope.get('Time')).$now(); return self.$record(results.$merge($hash2(["status", "finished_at", "run_time"], {"status": status, "finished_at": finished_at, "run_time": (finished_at['$-'](self.$execution_result()['$[]']("started_at"))).$to_f()}))); }; def.$run_before_each = function() { var self = this; self.example_group_instance.$setup_mocks_for_rspec(); return self.example_group_class.$run_before_each_hooks(self); }; def.$run_after_each = function() { var self = this, e = nil; try { try { self.example_group_class.$run_after_each_hooks(self); return self.$verify_mocks(); } catch ($err) {if ($opal.$rescue($err, [$scope.get('Exception')])) {e = $err; return self.$set_exception(e, "in an after(:each) hook") }else { throw $err; } } } finally { self.example_group_instance.$teardown_mocks_for_rspec() }; }; def.$verify_mocks = function() { var self = this, e = nil; try { return self.example_group_instance.$verify_mocks_for_rspec() } catch ($err) {if ($opal.$rescue($err, [$scope.get('Exception')])) {e = $err; return self.$set_exception(e, "dont_print") }else { throw $err; } }; }; def.$assign_generated_description = function() { var $a, $b, self = this; if ((($a = $scope.get('RSpec').$configuration()['$expecting_with_rspec?']()) !== nil && (!$a.$$is_boolean || $a == true))) { } else { return nil }; if ((($a = ($b = self.$metadata()['$[]']("description_args")['$empty?'](), $b !== false && $b !== nil ?self['$pending?']()['$!']() : $b)) !== nil && (!$a.$$is_boolean || $a == true))) { self.$metadata()['$[]']("description_args")['$<<']((($scope.get('RSpec')).$$scope.get('Matchers')).$generated_description())}; return (($scope.get('RSpec')).$$scope.get('Matchers')).$clear_generated_description(); }; return (def.$record = function(results) { var self = this; if (results == null) { results = $hash2([], {}) } return self.$execution_result().$update(results); }, nil) && 'record'; })(self, null) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/core/example_group"] = function($opal) { $opal.dynamic_require_severity = "warning"; var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass, $hash2 = $opal.hash2; $opal.add_stubs(['$extend', '$include', '$world', '$register', '$each', '$define_method', '$[]', '$metadata', '$call', '$format_docstrings_block', '$configuration', '$delegate_to_metadata', '$alias_method', '$build_hash_from', '$update', '$<<', '$examples', '$new', '$last', '$define_example_method', '$describe', '$find_and_eval_shared', '$to_proc', '$[]=', '$define_nested_shared_group_method', '$shared_example_groups', '$raise', '$inspect', '$module_exec', '$module_eval', '$filtered_examples', '$+', '$inject', '$descendant_filtered_examples', '$children', '$respond_to?', '$superclass', '$is_a?', '$subclass', '$set_it_up', '$assign_const', '$define_helpers_on', '$descendants', '$select', '$<', '$ancestors', '$==', '$configure_mock_framework', '$configure_expectation_framework', '$ensure_example_groups_are_configured', '$first', '$shift', '$unshift', '$process', '$superclass_metadata', '$register_globals', '$hooks', '$configure_group', '$empty?', '$instance_variables', '$before_all_ivars', '$instance_variable_get', '$instance_variable_set', '$assign_before_all_ivars', '$isolate_for_all_hook', '$run_hook', '$store_before_all_ivars', '$wants_to_quit', '$top_level?', '$clear_remaining_example_groups', '$example_group_started', '$run_before_all_hooks', '$run_examples', '$all?', '$map', '$run', '$order', '$ordering_strategy', '$fail_fast?', '$wants_to_quit=', '$fail_filtered_examples', '$run_after_all_hooks', '$clear', '$example_group_finished', '$fetch', '$ordering_registry', '$warn', '$gsub', '$set_ivars', '$!', '$fail_with_exception', '$any_apply?', '$all_apply?', '$collect', '$declaration_line_numbers', '$description', '$parent_groups', '$described_class', '$class', '$instance_exec', '$current_example', '$set_exception', '$base_name_for', '$constant_scope_for', '$disambiguate', '$const_set', '$gsub!', '$upcase', '$lstrip!', '$const_defined?', '$next!']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Core'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $ExampleGroup(){}; var self = $ExampleGroup = $klass($base, $super, 'ExampleGroup', $ExampleGroup); var def = self.$$proto, $scope = self.$$scope, TMP_7, TMP_8, TMP_9, TMP_11, TMP_12, TMP_27; self.$extend($scope.get('Hooks')); self.$include($scope.get('MemoizedHelpers')); self.$include($scope.get('Pending')); self.$extend($scope.get('SharedExampleGroup')); $opal.defs(self, '$world', function() { var self = this; return $scope.get('RSpec').$world(); }); $opal.defs(self, '$register', function() { var self = this; return self.$world().$register(self); }); (function(self) { var $scope = self.$$scope, def = self.$$proto; $opal.defs(self, '$delegate_to_metadata', function(names) { var $a, $b, TMP_1, self = this; names = $slice.call(arguments, 0); return ($a = ($b = names).$each, $a.$$p = (TMP_1 = function(name){var self = TMP_1.$$s || this, $a, $b, TMP_2; if (name == null) name = nil; return ($a = ($b = self).$define_method, $a.$$p = (TMP_2 = function(){var self = TMP_2.$$s || this; return self.$metadata()['$[]']("example_group")['$[]'](name)}, TMP_2.$$s = self, TMP_2), $a).call($b, name)}, TMP_1.$$s = self, TMP_1), $a).call($b); }); self.$$proto.$description = function() { var self = this, description = nil; description = self.$metadata()['$[]']("example_group")['$[]']("description"); return $scope.get('RSpec').$configuration().$format_docstrings_block().$call(description); }; self.$delegate_to_metadata("described_class", "file_path"); self.$alias_method("display_name", "description"); self.$alias_method("describes", "described_class"); $opal.defs(self, '$define_example_method', function(name, extra_options) { var $a, $b, TMP_3, self = this; if (extra_options == null) { extra_options = $hash2([], {}) } return ($a = ($b = self).$define_method, $a.$$p = (TMP_3 = function(all_args){var self = TMP_3.$$s || this, block, $a, desc = nil, args = nil, options = nil; all_args = $slice.call(arguments, 0); block = TMP_3.$$p || nil, TMP_3.$$p = null; ($a = all_args)['$to_a'] ? ($a = $a['$to_a']()) : ($a).$$is_array ? $a : ($a = [$a]), desc = ($a[0] == null ? nil : $a[0]), args = $slice.call($a, 1); options = $scope.get('Metadata').$build_hash_from(args); if (block !== false && block !== nil) { } else { options.$update($hash2(["pending"], {"pending": (((((($scope.get('RSpec')).$$scope.get('Core'))).$$scope.get('Pending'))).$$scope.get('NOT_YET_IMPLEMENTED'))})) }; options.$update(extra_options); self.$examples()['$<<']((((($scope.get('RSpec')).$$scope.get('Core'))).$$scope.get('Example')).$new(self, desc, options, block)); return self.$examples().$last();}, TMP_3.$$s = self, TMP_3), $a).call($b, name); }); self.$define_example_method("example"); self.$define_example_method("it"); self.$define_example_method("specify"); self.$define_example_method("focus", $hash2(["focused", "focus"], {"focused": true, "focus": true})); self.$define_example_method("focused", $hash2(["focused", "focus"], {"focused": true, "focus": true})); self.$define_example_method("fit", $hash2(["focused", "focus"], {"focused": true, "focus": true})); self.$define_example_method("pending", $hash2(["pending"], {"pending": true})); self.$define_example_method("xexample", $hash2(["pending"], {"pending": "Temporarily disabled with xexample"})); self.$define_example_method("xit", $hash2(["pending"], {"pending": "Temporarily disabled with xit"})); self.$define_example_method("xspecify", $hash2(["pending"], {"pending": "Temporarily disabled with xspecify"})); self.$$proto.$alias_example_to = function(name, extra) { var self = this; if (extra == null) { extra = $hash2([], {}) } return ((function(self) { var $scope = self.$$scope, def = self.$$proto; return self })(self.$singleton_class())).$define_example_method(name, extra); }; $opal.defs(self, '$define_nested_shared_group_method', function(new_name, report_label) { var $a, $b, TMP_4, self = this; if (report_label == null) { report_label = "it should behave like" } return ($a = ($b = self).$define_method, $a.$$p = (TMP_4 = function(name, args){var self = TMP_4.$$s || this, customization_block, $a, $b, TMP_5, group = nil; if (name == null) name = nil;args = $slice.call(arguments, 1); customization_block = TMP_4.$$p || nil, TMP_4.$$p = null; group = ($a = ($b = self).$describe, $a.$$p = (TMP_5 = function(){var self = TMP_5.$$s || this, $a, $b; return ($a = ($b = self).$find_and_eval_shared, $a.$$p = customization_block.$to_proc(), $a).apply($b, ["examples", name].concat(args))}, TMP_5.$$s = self, TMP_5), $a).call($b, "" + (report_label) + " " + (name)); group.$metadata()['$[]=']("shared_group_name", name); return group;}, TMP_4.$$s = self, TMP_4), $a).call($b, new_name); }); self.$define_nested_shared_group_method("it_behaves_like", "behaves like"); self.$define_nested_shared_group_method("it_should_behave_like"); return (self.$$proto.$alias_it_behaves_like_to = TMP_6 = function(name, args) { var $a, $b, self = this, $iter = TMP_6.$$p, block = $iter || nil; args = $slice.call(arguments, 1); TMP_6.$$p = null; return ($a = ($b = ((function(self) { var $scope = self.$$scope, def = self.$$proto; return self })(self.$singleton_class()))).$define_nested_shared_group_method, $a.$$p = block.$to_proc(), $a).apply($b, [name].concat(args)); }, nil) && 'alias_it_behaves_like_to'; })(self.$singleton_class()); $opal.defs(self, '$include_context', TMP_7 = function(name, args) { var $a, $b, self = this, $iter = TMP_7.$$p, block = $iter || nil; args = $slice.call(arguments, 1); TMP_7.$$p = null; return ($a = ($b = self).$find_and_eval_shared, $a.$$p = block.$to_proc(), $a).apply($b, ["context", name].concat(args)); }); $opal.defs(self, '$include_examples', TMP_8 = function(name, args) { var $a, $b, self = this, $iter = TMP_8.$$p, block = $iter || nil; args = $slice.call(arguments, 1); TMP_8.$$p = null; return ($a = ($b = self).$find_and_eval_shared, $a.$$p = block.$to_proc(), $a).apply($b, ["examples", name].concat(args)); }); $opal.defs(self, '$find_and_eval_shared', TMP_9 = function(label, name, args) { var $a, $b, $c, self = this, $iter = TMP_9.$$p, customization_block = $iter || nil, shared_block = nil; args = $slice.call(arguments, 2); TMP_9.$$p = null; if ((($a = shared_block = self.$shared_example_groups()['$[]'](name)) !== nil && (!$a.$$is_boolean || $a == true))) { } else { self.$raise($scope.get('ArgumentError'), "Could not find shared " + (label) + " " + (name.$inspect())) }; ($a = ($b = self).$module_exec, $a.$$p = shared_block.$to_proc(), $a).apply($b, [].concat(args)); if (customization_block !== false && customization_block !== nil) { return ($a = ($c = self).$module_eval, $a.$$p = customization_block.$to_proc(), $a).call($c) } else { return nil }; }); $opal.defs(self, '$examples', function() { var $a, self = this; if (self.examples == null) self.examples = nil; return ((($a = self.examples) !== false && $a !== nil) ? $a : self.examples = []); }); $opal.defs(self, '$filtered_examples', function() { var self = this; return self.$world().$filtered_examples()['$[]'](self); }); $opal.defs(self, '$descendant_filtered_examples', function() { var $a, $b, $c, TMP_10, self = this; if (self.descendant_filtered_examples == null) self.descendant_filtered_examples = nil; return ((($a = self.descendant_filtered_examples) !== false && $a !== nil) ? $a : self.descendant_filtered_examples = self.$filtered_examples()['$+'](($b = ($c = self.$children()).$inject, $b.$$p = (TMP_10 = function(l, c){var self = TMP_10.$$s || this; if (l == null) l = nil;if (c == null) c = nil; return l['$+'](c.$descendant_filtered_examples())}, TMP_10.$$s = self, TMP_10), $b).call($c, []))); }); $opal.defs(self, '$metadata', function() { var $a, $b, self = this; if (self.metadata == null) self.metadata = nil; if ((($a = (($b = self['metadata'], $b != null && $b !== nil) ? 'instance-variable' : nil)) !== nil && (!$a.$$is_boolean || $a == true))) { return self.metadata } else { return nil }; }); $opal.defs(self, '$superclass_metadata', function() { var $a, $b, self = this; if (self.superclass_metadata == null) self.superclass_metadata = nil; return ((($a = self.superclass_metadata) !== false && $a !== nil) ? $a : self.superclass_metadata = (function() {if ((($b = self.$superclass()['$respond_to?']("metadata")) !== nil && (!$b.$$is_boolean || $b == true))) { return self.$superclass().$metadata() } else { return nil }; return nil; })()); }); $opal.defs(self, '$describe', TMP_11 = function(args) { var $a, $b, self = this, $iter = TMP_11.$$p, example_group_block = $iter || nil, child = nil; args = $slice.call(arguments, 0); TMP_11.$$p = null; if ((($a = args.$last()['$is_a?']($scope.get('Hash'))) !== nil && (!$a.$$is_boolean || $a == true))) { } else { args['$<<']($hash2([], {})) }; args.$last().$update($hash2(["example_group_block"], {"example_group_block": example_group_block})); child = ($a = ($b = self).$subclass, $a.$$p = example_group_block.$to_proc(), $a).call($b, self, args); self.$children()['$<<'](child); return child; }); (function(self) { var $scope = self.$$scope, def = self.$$proto; return self.$alias_method("context", "describe") })(self.$singleton_class()); $opal.defs(self, '$subclass', TMP_12 = function(parent, args) { var $a, $b, $c, self = this, $iter = TMP_12.$$p, example_group_block = $iter || nil, subclass = nil; TMP_12.$$p = null; subclass = $scope.get('Class').$new(parent); ($a = subclass).$set_it_up.apply($a, [].concat(args)); $scope.get('ExampleGroups').$assign_const(subclass); if (example_group_block !== false && example_group_block !== nil) { ($b = ($c = subclass).$module_eval, $b.$$p = example_group_block.$to_proc(), $b).call($c)}; $scope.get('MemoizedHelpers').$define_helpers_on(subclass); return subclass; }); $opal.defs(self, '$children', function() { var $a, self = this; if (self.children == null) self.children = nil; return ((($a = self.children) !== false && $a !== nil) ? $a : self.children = []); }); $opal.defs(self, '$descendants', function() { var $a, $b, $c, TMP_13, self = this; if (self._descendants == null) self._descendants = nil; return ((($a = self._descendants) !== false && $a !== nil) ? $a : self._descendants = [self]['$+'](($b = ($c = self.$children()).$inject, $b.$$p = (TMP_13 = function(list, c){var self = TMP_13.$$s || this; if (list == null) list = nil;if (c == null) c = nil; return list['$+'](c.$descendants())}, TMP_13.$$s = self, TMP_13), $b).call($c, []))); }); $opal.defs(self, '$parent_groups', function() { var $a, $b, $c, TMP_14, self = this; if (self.parent_groups == null) self.parent_groups = nil; return ((($a = self.parent_groups) !== false && $a !== nil) ? $a : self.parent_groups = ($b = ($c = self.$ancestors()).$select, $b.$$p = (TMP_14 = function(a){var self = TMP_14.$$s || this; if (a == null) a = nil; return a['$<']((((($scope.get('RSpec')).$$scope.get('Core'))).$$scope.get('ExampleGroup')))}, TMP_14.$$s = self, TMP_14), $b).call($c)); }); $opal.defs(self, '$top_level?', function() { var $a, self = this; if (self.top_level == null) self.top_level = nil; return ((($a = self.top_level) !== false && $a !== nil) ? $a : self.top_level = self.$superclass()['$==']($scope.get('ExampleGroup'))); }); $opal.defs(self, '$ensure_example_groups_are_configured', function() { var $a, self = this; if ((($a = ($opal.cvars['@@example_groups_configured'] != null ? 'class variable' : nil)) !== nil && (!$a.$$is_boolean || $a == true))) { return nil } else { $scope.get('RSpec').$configuration().$configure_mock_framework(); $scope.get('RSpec').$configuration().$configure_expectation_framework(); return ($opal.cvars['@@example_groups_configured'] = true); }; }); $opal.defs(self, '$set_it_up', function(args) { var $a, self = this, symbol_description = nil; args = $slice.call(arguments, 0); self.$ensure_example_groups_are_configured(); if ((($a = args.$first()['$is_a?']($scope.get('Symbol'))) !== nil && (!$a.$$is_boolean || $a == true))) { symbol_description = args.$shift()}; args['$<<']($scope.get('Metadata').$build_hash_from(args)); if (symbol_description !== false && symbol_description !== nil) { args.$unshift(symbol_description)}; self.metadata = ($a = (((($scope.get('RSpec')).$$scope.get('Core'))).$$scope.get('Metadata')).$new(self.$superclass_metadata())).$process.apply($a, [].concat(args)); self.order = nil; self.$hooks().$register_globals(self, $scope.get('RSpec').$configuration().$hooks()); return self.$world().$configure_group(self); }); $opal.defs(self, '$before_all_ivars', function() { var $a, self = this; if (self.before_all_ivars == null) self.before_all_ivars = nil; return ((($a = self.before_all_ivars) !== false && $a !== nil) ? $a : self.before_all_ivars = $hash2([], {})); }); $opal.defs(self, '$store_before_all_ivars', function(example_group_instance) { var $a, $b, TMP_15, self = this; if ((($a = example_group_instance.$instance_variables()['$empty?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return nil}; return ($a = ($b = example_group_instance.$instance_variables()).$each, $a.$$p = (TMP_15 = function(ivar){var self = TMP_15.$$s || this; if (ivar == null) ivar = nil; return self.$before_all_ivars()['$[]='](ivar, example_group_instance.$instance_variable_get(ivar))}, TMP_15.$$s = self, TMP_15), $a).call($b); }); $opal.defs(self, '$assign_before_all_ivars', function(ivars, example_group_instance) { var $a, $b, TMP_16, self = this; return ($a = ($b = ivars).$each, $a.$$p = (TMP_16 = function(ivar, val){var self = TMP_16.$$s || this; if (ivar == null) ivar = nil;if (val == null) val = nil; return example_group_instance.$instance_variable_set(ivar, val)}, TMP_16.$$s = self, TMP_16), $a).call($b); }); $opal.defs(self, '$run_before_all_hooks', function(example_group_instance) { var $a, $b, TMP_17, self = this; if ((($a = self.$descendant_filtered_examples()['$empty?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return nil}; try { self.$assign_before_all_ivars(self.$superclass().$before_all_ivars(), example_group_instance); return ($a = ($b = (($scope.get('AllHookMemoizedHash')).$$scope.get('Before'))).$isolate_for_all_hook, $a.$$p = (TMP_17 = function(){var self = TMP_17.$$s || this; return self.$run_hook("before", "all", example_group_instance)}, TMP_17.$$s = self, TMP_17), $a).call($b, example_group_instance); } finally { self.$store_before_all_ivars(example_group_instance) }; }); $opal.defs(self, '$run_around_each_hooks', function(example, initial_procsy) { var self = this; return self.$run_hook("around", "each", example, initial_procsy); }); $opal.defs(self, '$run_before_each_hooks', function(example) { var self = this; return self.$run_hook("before", "each", example); }); $opal.defs(self, '$run_after_each_hooks', function(example) { var self = this; return self.$run_hook("after", "each", example); }); $opal.defs(self, '$run_after_all_hooks', function(example_group_instance) { var $a, $b, TMP_18, self = this; if ((($a = self.$descendant_filtered_examples()['$empty?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return nil}; self.$assign_before_all_ivars(self.$before_all_ivars(), example_group_instance); return ($a = ($b = (($scope.get('AllHookMemoizedHash')).$$scope.get('After'))).$isolate_for_all_hook, $a.$$p = (TMP_18 = function(){var self = TMP_18.$$s || this; return self.$run_hook("after", "all", example_group_instance)}, TMP_18.$$s = self, TMP_18), $a).call($b, example_group_instance); }); $opal.defs(self, '$run', function(reporter) { var $a, $b, TMP_19, $c, self = this, result_for_this_group = nil, results_for_descendants = nil, ex = nil; if ((($a = $scope.get('RSpec').$wants_to_quit()) !== nil && (!$a.$$is_boolean || $a == true))) { if ((($a = self['$top_level?']()) !== nil && (!$a.$$is_boolean || $a == true))) { $scope.get('RSpec').$clear_remaining_example_groups()}; return nil;}; reporter.$example_group_started(self); try { try { self.$run_before_all_hooks(self.$new()); result_for_this_group = self.$run_examples(reporter); results_for_descendants = ($a = ($b = self.$ordering_strategy().$order(self.$children())).$map, $a.$$p = (TMP_19 = function(child){var self = TMP_19.$$s || this; if (child == null) child = nil; return child.$run(reporter)}, TMP_19.$$s = self, TMP_19), $a).call($b)['$all?'](); return (($a = result_for_this_group !== false && result_for_this_group !== nil) ? results_for_descendants : $a); } catch ($err) {if ($opal.$rescue($err, [$scope.get('Exception')])) {ex = $err; if ((($a = self['$fail_fast?']()) !== nil && (!$a.$$is_boolean || $a == true))) { (($a = [true]), $c = $scope.get('RSpec'), $c['$wants_to_quit='].apply($c, $a), $a[$a.length-1])}; return self.$fail_filtered_examples(ex, reporter); }else { throw $err; } } } finally { self.$run_after_all_hooks(self.$new()); self.$before_all_ivars().$clear(); reporter.$example_group_finished(self); }; }); $opal.defs(self, '$ordering_strategy', function() { var $a, $b, TMP_20, self = this, order = nil, registry = nil; order = self.$metadata().$fetch("order", "global"); registry = $scope.get('RSpec').$configuration().$ordering_registry(); return ($a = ($b = registry).$fetch, $a.$$p = (TMP_20 = function(){var self = TMP_20.$$s || this; self.$warn((((((" |WARNING: Ignoring unknown ordering specified using `:order => ") + (order.$inspect())) + "` metadata.\n | Falling back to configured global ordering.\n | Unrecognized ordering specified at: ") + (self.$metadata()['$[]']("example_group")['$[]']("location"))) + "\n").$gsub(/^ +\|/, "")); return registry.$fetch("global");}, TMP_20.$$s = self, TMP_20), $a).call($b, order); }); $opal.defs(self, '$run_examples', function(reporter) { var $a, $b, TMP_21, self = this; return ($a = ($b = self.$ordering_strategy().$order(self.$filtered_examples())).$map, $a.$$p = (TMP_21 = function(example){var self = TMP_21.$$s || this, $a, $b, instance = nil, succeeded = nil; if (example == null) example = nil; if ((($a = $scope.get('RSpec').$wants_to_quit()) !== nil && (!$a.$$is_boolean || $a == true))) { return nil;}; instance = self.$new(); self.$set_ivars(instance, self.$before_all_ivars()); succeeded = example.$run(instance, reporter); if ((($a = ($b = self['$fail_fast?'](), $b !== false && $b !== nil ?succeeded['$!']() : $b)) !== nil && (!$a.$$is_boolean || $a == true))) { (($a = [true]), $b = $scope.get('RSpec'), $b['$wants_to_quit='].apply($b, $a), $a[$a.length-1])}; return succeeded;}, TMP_21.$$s = self, TMP_21), $a).call($b)['$all?'](); }); $opal.defs(self, '$fail_filtered_examples', function(exception, reporter) { var $a, $b, TMP_22, $c, TMP_23, self = this; ($a = ($b = self.$filtered_examples()).$each, $a.$$p = (TMP_22 = function(example){var self = TMP_22.$$s || this; if (example == null) example = nil; return example.$fail_with_exception(reporter, exception)}, TMP_22.$$s = self, TMP_22), $a).call($b); ($a = ($c = self.$children()).$each, $a.$$p = (TMP_23 = function(child){var self = TMP_23.$$s || this; if (child == null) child = nil; reporter.$example_group_started(child); child.$fail_filtered_examples(exception, reporter); return reporter.$example_group_finished(child);}, TMP_23.$$s = self, TMP_23), $a).call($c); return false; }); $opal.defs(self, '$fail_fast?', function() { var self = this; return $scope.get('RSpec').$configuration()['$fail_fast?'](); }); $opal.defs(self, '$any_apply?', function(filters) { var self = this; return self.$metadata()['$any_apply?'](filters); }); $opal.defs(self, '$all_apply?', function(filters) { var self = this; return self.$metadata()['$all_apply?'](filters); }); $opal.defs(self, '$declaration_line_numbers', function() { var $a, $b, $c, TMP_24, $d, TMP_25, self = this; if (self.declaration_line_numbers == null) self.declaration_line_numbers = nil; return ((($a = self.declaration_line_numbers) !== false && $a !== nil) ? $a : self.declaration_line_numbers = [self.$metadata()['$[]']("example_group")['$[]']("line_number")]['$+'](($b = ($c = self.$examples()).$collect, $b.$$p = (TMP_24 = function(e){var self = TMP_24.$$s || this; if (e == null) e = nil; return e.$metadata()['$[]']("line_number")}, TMP_24.$$s = self, TMP_24), $b).call($c))['$+'](($b = ($d = self.$children()).$inject, $b.$$p = (TMP_25 = function(l, c){var self = TMP_25.$$s || this; if (l == null) l = nil;if (c == null) c = nil; return l['$+'](c.$declaration_line_numbers())}, TMP_25.$$s = self, TMP_25), $b).call($d, []))); }); $opal.defs(self, '$top_level_description', function() { var self = this; return self.$parent_groups().$last().$description(); }); $opal.defs(self, '$set_ivars', function(instance, ivars) { var $a, $b, TMP_26, self = this; return ($a = ($b = ivars).$each, $a.$$p = (TMP_26 = function(name, value){var self = TMP_26.$$s || this; if (name == null) name = nil;if (value == null) value = nil; return instance.$instance_variable_set(name, value)}, TMP_26.$$s = self, TMP_26), $a).call($b); }); def.$described_class = function() { var self = this; return self.$class().$described_class(); }; return (def.$instance_exec_with_rescue = TMP_27 = function(example, context) { var $a, $b, self = this, $iter = TMP_27.$$p, hook = $iter || nil, e = nil; if (context == null) { context = nil } TMP_27.$$p = null; try { return ($a = ($b = self).$instance_exec, $a.$$p = hook.$to_proc(), $a).call($b, example) } catch ($err) {if ($opal.$rescue($err, [$scope.get('Exception')])) {e = $err; if ((($a = $scope.get('RSpec').$current_example()) !== nil && (!$a.$$is_boolean || $a == true))) { return $scope.get('RSpec').$current_example().$set_exception(e, context) } else { return self.$raise() } }else { throw $err; } }; }, nil) && 'instance_exec_with_rescue'; })(self, null) })(self); (function($base) { var self = $module($base, 'ExampleGroups'); var def = self.$$proto, $scope = self.$$scope; $opal.defs(self, '$assign_const', function(group) { var self = this, base_name = nil, const_scope = nil, name = nil; base_name = self.$base_name_for(group); const_scope = self.$constant_scope_for(group); name = self.$disambiguate(base_name, const_scope); return const_scope.$const_set(name, group); }); $opal.defs(self, '$constant_scope_for', function(group) { var self = this, const_scope = nil; const_scope = group.$superclass(); if (const_scope['$==']((($scope.get('Core')).$$scope.get('ExampleGroup')))) { const_scope = self}; return const_scope; }); $opal.defs(self, '$base_name_for', function(group) { var $a, $b, TMP_28, self = this, name = nil; if ((($a = group.$description()['$empty?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return "Anonymous"}; name = " "['$+'](group.$description()); ($a = ($b = name)['$gsub!'], $a.$$p = (TMP_28 = function(){var self = TMP_28.$$s || this; return nil.$upcase()}, TMP_28.$$s = self, TMP_28), $a).call($b, /[^0-9a-zA-Z]+([0-9a-zA-Z])/); name['$lstrip!'](); name['$gsub!'](/\W/, ""); name['$gsub!'](/\A([^A-Z]|\z)/, "Nested\\1"); return name; }); $opal.defs(self, '$disambiguate', function(name, const_scope) { var $a, $b, self = this; if ((($a = const_scope['$const_defined?'](name)) !== nil && (!$a.$$is_boolean || $a == true))) { } else { return name }; name['$<<']("_2"); while ((($b = const_scope['$const_defined?'](name)) !== nil && (!$b.$$is_boolean || $b == true))) { name['$next!']()}; return name; }); })(self); })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/core/filter_manager"] = function($opal) { $opal.dynamic_require_severity = "warning"; var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass, $hash2 = $opal.hash2; $opal.add_stubs(['$expand_path', '$gsub', '$inspect', '$inspect_filter_hash', '$lambda', '$!', '$each', '$store', '$without_conditional_filters', '$empty?', '$private', '$reject', '$==', '$[]', '$_warn_deprecated_keys', '$last', '$has_key?', '$_warn_deprecated_key', '$deprecate', '$[]=', '$delete', '$attr_reader', '$new', '$extend', '$push', '$replace', '$clear', '$inclusions', '$empty_without_conditional_filters?', '$exclusions', '$select', '$exclude?', '$include?', '$merge', '$reverse_merge', '$any_apply?', '$unless_standalone', '$already_set_standalone_filter?', '$is_standalone_filter?', '$each_key', '$merge!', '$each_pair', '$any?']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Core'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $FilterManager(){}; var self = $FilterManager = $klass($base, $super, 'FilterManager', $FilterManager); var def = self.$$proto, $scope = self.$$scope, TMP_13; def.inclusions = def.exclusions = nil; $opal.cdecl($scope, 'STANDALONE_FILTERS', ["locations", "line_numbers", "full_description"]); $opal.cdecl($scope, 'PROC_HEX_NUMBER', /0x[0-9a-f]+@/); $opal.cdecl($scope, 'PROJECT_DIR', $scope.get('File').$expand_path(".")); $opal.defs(self, '$inspect_filter_hash', function(hash) { var self = this; return hash.$inspect().$gsub($scope.get('PROC_HEX_NUMBER'), "").$gsub($scope.get('PROJECT_DIR'), ".").$gsub(" (lambda)", ""); }); (function($base, $super) { function $InclusionFilterHash(){}; var self = $InclusionFilterHash = $klass($base, $super, 'InclusionFilterHash', $InclusionFilterHash); var def = self.$$proto, $scope = self.$$scope; return (def.$description = function() { var self = this; return $scope.get('FilterManager').$inspect_filter_hash(self); }, nil) && 'description' })(self, $scope.get('Hash')); (function($base, $super) { function $ExclusionFilterHash(){}; var self = $ExclusionFilterHash = $klass($base, $super, 'ExclusionFilterHash', $ExclusionFilterHash); var def = self.$$proto, $scope = self.$$scope, $a, $b, TMP_1, $c, TMP_2, TMP_3; $opal.cdecl($scope, 'CONDITIONAL_FILTERS', $hash2(["if", "unless"], {"if": ($a = ($b = self).$lambda, $a.$$p = (TMP_1 = function(value){var self = TMP_1.$$s || this; if (value == null) value = nil; return value['$!']()}, TMP_1.$$s = self, TMP_1), $a).call($b), "unless": ($a = ($c = self).$lambda, $a.$$p = (TMP_2 = function(value){var self = TMP_2.$$s || this; if (value == null) value = nil; return value}, TMP_2.$$s = self, TMP_2), $a).call($c)})); def.$initialize = TMP_3 = function() {var $zuper = $slice.call(arguments, 0); var $a, $b, TMP_4, self = this, $iter = TMP_3.$$p, $yield = $iter || nil; TMP_3.$$p = null; $opal.find_super_dispatcher(self, 'initialize', TMP_3, $iter).apply(self, $zuper); return ($a = ($b = $scope.get('CONDITIONAL_FILTERS')).$each, $a.$$p = (TMP_4 = function(k, v){var self = TMP_4.$$s || this; if (k == null) k = nil;if (v == null) v = nil; return self.$store(k, v)}, TMP_4.$$s = self, TMP_4), $a).call($b); }; def.$description = function() { var self = this; return $scope.get('FilterManager').$inspect_filter_hash(self.$without_conditional_filters()); }; def['$empty_without_conditional_filters?'] = function() { var self = this; return self.$without_conditional_filters()['$empty?'](); }; self.$private(); return (def.$without_conditional_filters = function() { var $a, $b, TMP_5, self = this; return ($a = ($b = self).$reject, $a.$$p = (TMP_5 = function(k, v){var self = TMP_5.$$s || this; if (k == null) k = nil;if (v == null) v = nil; return $scope.get('CONDITIONAL_FILTERS')['$[]'](k)['$=='](v)}, TMP_5.$$s = self, TMP_5), $a).call($b); }, nil) && 'without_conditional_filters'; })(self, $scope.get('Hash')); (function($base) { var self = $module($base, 'BackwardCompatibility'); var def = self.$$proto, $scope = self.$$scope, TMP_6, TMP_7; def.$merge = TMP_6 = function(orig, opposite, updates) {var $zuper = $slice.call(arguments, 0); var self = this, $iter = TMP_6.$$p, $yield = $iter || nil; updates = $slice.call(arguments, 2); TMP_6.$$p = null; self.$_warn_deprecated_keys(updates.$last()); return $opal.find_super_dispatcher(self, 'merge', TMP_6, $iter).apply(self, $zuper); }; def.$reverse_merge = TMP_7 = function(orig, opposite, updates) {var $zuper = $slice.call(arguments, 0); var self = this, $iter = TMP_7.$$p, $yield = $iter || nil; updates = $slice.call(arguments, 2); TMP_7.$$p = null; self.$_warn_deprecated_keys(updates.$last()); return $opal.find_super_dispatcher(self, 'reverse_merge', TMP_7, $iter).apply(self, $zuper); }; def.$_warn_deprecated_keys = function(updates) { var $a, self = this; if ((($a = updates['$has_key?']("unless")) !== nil && (!$a.$$is_boolean || $a == true))) { self.$_warn_deprecated_key("unless", updates)}; if ((($a = updates['$has_key?']("if")) !== nil && (!$a.$$is_boolean || $a == true))) { return self.$_warn_deprecated_key("if", updates) } else { return nil }; }; def.$_warn_deprecated_key = function(key, updates) { var self = this; if (self.exclusions == null) self.exclusions = nil; $scope.get('RSpec').$deprecate("FilterManager#exclude(" + (key.$inspect()) + " => " + (updates['$[]'](key).$inspect()) + ")"); return self.exclusions['$[]='](key, updates.$delete(key)); }; ;$opal.donate(self, ["$merge", "$reverse_merge", "$_warn_deprecated_keys", "$_warn_deprecated_key"]); })(self); self.$attr_reader("exclusions", "inclusions"); def.$initialize = function() { var self = this; self.exclusions = $scope.get('ExclusionFilterHash').$new(); self.inclusions = $scope.get('InclusionFilterHash').$new(); return self.$extend($scope.get('BackwardCompatibility')); }; def.$add_location = function(file_path, line_numbers) { var $a, $b, $c, TMP_8, self = this, locations = nil; locations = ((($a = self.inclusions.$delete("locations")) !== false && $a !== nil) ? $a : ($b = ($c = $scope.get('Hash')).$new, $b.$$p = (TMP_8 = function(h, k){var self = TMP_8.$$s || this; if (h == null) h = nil;if (k == null) k = nil; return h['$[]='](k, [])}, TMP_8.$$s = self, TMP_8), $b).call($c)); ($a = locations['$[]']($scope.get('File').$expand_path(file_path))).$push.apply($a, [].concat(line_numbers)); self.inclusions.$replace($hash2(["locations"], {"locations": locations})); return self.exclusions.$clear(); }; def['$empty?'] = function() { var $a, self = this; return ($a = self.$inclusions()['$empty?'](), $a !== false && $a !== nil ?self.$exclusions()['$empty_without_conditional_filters?']() : $a); }; def.$prune = function(examples) { var $a, $b, TMP_9, self = this; return ($a = ($b = examples).$select, $a.$$p = (TMP_9 = function(e){var self = TMP_9.$$s || this, $a; if (e == null) e = nil; return ($a = self['$exclude?'](e)['$!'](), $a !== false && $a !== nil ?self['$include?'](e) : $a)}, TMP_9.$$s = self, TMP_9), $a).call($b); }; def.$exclude = function(args) { var $a, self = this; args = $slice.call(arguments, 0); return ($a = self).$merge.apply($a, [self.exclusions, self.inclusions].concat(args)); }; def['$exclude!'] = function(args) { var $a, self = this; args = $slice.call(arguments, 0); return ($a = self).$replace.apply($a, [self.exclusions, self.inclusions].concat(args)); }; def.$exclude_with_low_priority = function(args) { var $a, self = this; args = $slice.call(arguments, 0); return ($a = self).$reverse_merge.apply($a, [self.exclusions, self.inclusions].concat(args)); }; def['$exclude?'] = function(example) { var $a, self = this; if ((($a = self.exclusions['$empty?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return false } else { return example['$any_apply?'](self.exclusions) }; }; def.$include = function(args) { var $a, $b, TMP_10, self = this; args = $slice.call(arguments, 0); return ($a = ($b = self).$unless_standalone, $a.$$p = (TMP_10 = function(){var self = TMP_10.$$s || this, $a; if (self.inclusions == null) self.inclusions = nil; if (self.exclusions == null) self.exclusions = nil; return ($a = self).$merge.apply($a, [self.inclusions, self.exclusions].concat(args))}, TMP_10.$$s = self, TMP_10), $a).apply($b, [].concat(args)); }; def['$include!'] = function(args) { var $a, $b, TMP_11, self = this; args = $slice.call(arguments, 0); return ($a = ($b = self).$unless_standalone, $a.$$p = (TMP_11 = function(){var self = TMP_11.$$s || this, $a; if (self.inclusions == null) self.inclusions = nil; if (self.exclusions == null) self.exclusions = nil; return ($a = self).$replace.apply($a, [self.inclusions, self.exclusions].concat(args))}, TMP_11.$$s = self, TMP_11), $a).apply($b, [].concat(args)); }; def.$include_with_low_priority = function(args) { var $a, $b, TMP_12, self = this; args = $slice.call(arguments, 0); return ($a = ($b = self).$unless_standalone, $a.$$p = (TMP_12 = function(){var self = TMP_12.$$s || this, $a; if (self.inclusions == null) self.inclusions = nil; if (self.exclusions == null) self.exclusions = nil; return ($a = self).$reverse_merge.apply($a, [self.inclusions, self.exclusions].concat(args))}, TMP_12.$$s = self, TMP_12), $a).apply($b, [].concat(args)); }; def['$include?'] = function(example) { var $a, self = this; if ((($a = self.inclusions['$empty?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return true } else { return example['$any_apply?'](self.inclusions) }; }; self.$private(); def.$unless_standalone = TMP_13 = function(args) { var $a, self = this, $iter = TMP_13.$$p, $yield = $iter || nil; args = $slice.call(arguments, 0); TMP_13.$$p = null; if ((($a = self['$already_set_standalone_filter?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return nil } else if ((($a = self['$is_standalone_filter?'](args.$last())) !== nil && (!$a.$$is_boolean || $a == true))) { return self.inclusions.$replace(args.$last()) } else { return $a = $opal.$yieldX($yield, []), $a === $breaker ? $a : $a }; }; def.$merge = function(orig, opposite, updates) { var $a, $b, TMP_14, self = this; updates = $slice.call(arguments, 2); return ($a = ($b = orig['$merge!'](updates.$last())).$each_key, $a.$$p = (TMP_14 = function(k){var self = TMP_14.$$s || this; if (k == null) k = nil; return opposite.$delete(k)}, TMP_14.$$s = self, TMP_14), $a).call($b); }; def.$replace = function(orig, opposite, updates) { var $a, $b, TMP_15, self = this; updates = $slice.call(arguments, 2); ($a = ($b = updates.$last()).$each_key, $a.$$p = (TMP_15 = function(k){var self = TMP_15.$$s || this; if (k == null) k = nil; return opposite.$delete(k)}, TMP_15.$$s = self, TMP_15), $a).call($b); return orig.$replace(updates.$last()); }; def.$reverse_merge = function(orig, opposite, updates) { var $a, $b, TMP_16, self = this, updated = nil; updates = $slice.call(arguments, 2); updated = updates.$last().$merge(orig); ($a = ($b = opposite).$each_pair, $a.$$p = (TMP_16 = function(k, v){var self = TMP_16.$$s || this; if (k == null) k = nil;if (v == null) v = nil; if (updated['$[]'](k)['$=='](v)) { return updated.$delete(k) } else { return nil }}, TMP_16.$$s = self, TMP_16), $a).call($b); return orig.$replace(updated); }; def['$already_set_standalone_filter?'] = function() { var self = this; return self['$is_standalone_filter?'](self.$inclusions()); }; return (def['$is_standalone_filter?'] = function(filter) { var $a, $b, TMP_17, self = this; return ($a = ($b = $scope.get('STANDALONE_FILTERS'))['$any?'], $a.$$p = (TMP_17 = function(key){var self = TMP_17.$$s || this; if (key == null) key = nil; return filter['$has_key?'](key)}, TMP_17.$$s = self, TMP_17), $a).call($b); }, nil) && 'is_standalone_filter?'; })(self, null) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/core/flat_map"] = function($opal) { $opal.dynamic_require_severity = "warning"; var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module; $opal.add_stubs(['$respond_to?', '$flat_map', '$flatten', '$map', '$module_function']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Core'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'FlatMap'); var def = self.$$proto, $scope = self.$$scope, $a, TMP_2, TMP_4; if ((($a = []['$respond_to?']("flat_map")) !== nil && (!$a.$$is_boolean || $a == true))) { def.$flat_map = TMP_2 = function(array) { var $a, $b, TMP_1, self = this, $iter = TMP_2.$$p, $yield = $iter || nil; TMP_2.$$p = null; return ($a = ($b = array).$flat_map, $a.$$p = (TMP_1 = function(item){var self = TMP_1.$$s || this, $a; if (item == null) item = nil; return $a = $opal.$yield1($yield, item), $a === $breaker ? $a : $a}, TMP_1.$$s = self, TMP_1), $a).call($b); } } else { def.$flat_map = TMP_4 = function(array) { var $a, $b, TMP_3, self = this, $iter = TMP_4.$$p, $yield = $iter || nil; TMP_4.$$p = null; return ($a = ($b = array).$map, $a.$$p = (TMP_3 = function(item){var self = TMP_3.$$s || this, $a; if (item == null) item = nil; return $a = $opal.$yield1($yield, item), $a === $breaker ? $a : $a}, TMP_3.$$s = self, TMP_3), $a).call($b).$flatten(); } }; self.$module_function("flat_map"); ;$opal.donate(self, ["$flat_map", "$flat_map"]); })(self) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/core/formatters/base_formatter"] = function($opal) { $opal.dynamic_require_severity = "warning"; var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass, $range = $opal.range, $hash2 = $opal.hash2; $opal.add_stubs(['$require', '$include', '$attr_accessor', '$attr_reader', '$new', '$start_sync_output', '$<<', '$examples', '$restore_sync_output', '$format_backtrace', '$backtrace_formatter', '$configuration', '$metadata', '$protected', '$find_failed_line', '$backtrace', '$file_path', '$[]', '$match', '$exist?', '$readlines', '$-', '$to_i', '$expand_path', '$detect', '$==', '$downcase', '$output_supports_sync', '$sync', '$output', '$sync=', '$!', '$closed?', '$respond_to?', '$profile_examples', '$fail_fast', '$color_enabled?', '$profile_examples?', '$fail_fast?', '$first', '$reverse', '$sort_by', '$execution_result', '$map', '$inject', '$+', '$each', '$last', '$parent_groups', '$example_group', '$[]=', '$has_key?', '$top_level_description', '$<=', '$length', '$keys', '$each_value', '$/', '$to_f', '$-@']); self.$require("rspec/core/formatters/helpers"); self.$require("stringio"); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Core'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Formatters'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $BaseFormatter(){}; var self = $BaseFormatter = $klass($base, $super, 'BaseFormatter', $BaseFormatter); var def = self.$$proto, $scope = self.$$scope; def.pending_examples = def.failed_examples = def.old_sync = nil; self.$include($scope.get('Helpers')); self.$attr_accessor("example_group"); self.$attr_reader("duration", "examples", "output"); self.$attr_reader("example_count", "pending_count", "failure_count"); self.$attr_reader("failed_examples", "pending_examples"); def.$initialize = function(output) { var $a, self = this; self.output = ((($a = output) !== false && $a !== nil) ? $a : $scope.get('StringIO').$new()); self.example_count = self.pending_count = self.failure_count = 0; self.examples = []; self.failed_examples = []; self.pending_examples = []; return self.example_group = nil; }; def.$start = function(example_count) { var self = this; self.$start_sync_output(); return self.example_count = example_count; }; def.$example_group_started = function(example_group) { var self = this; return self.example_group = example_group; }; def.$example_group_finished = function(example_group) { var self = this; return nil; }; def.$example_started = function(example) { var self = this; return self.$examples()['$<<'](example); }; def.$example_passed = function(example) { var self = this; return nil; }; def.$example_pending = function(example) { var self = this; return self.pending_examples['$<<'](example); }; def.$example_failed = function(example) { var self = this; return self.failed_examples['$<<'](example); }; def.$message = function(message) { var self = this; return nil; }; def.$stop = function() { var self = this; return nil; }; def.$start_dump = function() { var self = this; return nil; }; def.$dump_failures = function() { var self = this; return nil; }; def.$dump_summary = function(duration, example_count, failure_count, pending_count) { var self = this; self.duration = duration; self.example_count = example_count; self.failure_count = failure_count; return self.pending_count = pending_count; }; def.$dump_pending = function() { var self = this; return nil; }; def.$dump_profile = function() { var self = this; return nil; }; def.$seed = function(number) { var self = this; return nil; }; def.$close = function() { var self = this; return self.$restore_sync_output(); }; def.$format_backtrace = function(backtrace, example) { var self = this; return self.$configuration().$backtrace_formatter().$format_backtrace(backtrace, example.$metadata()); }; self.$protected(); def.$configuration = function() { var self = this; return $scope.get('RSpec').$configuration(); }; def.$read_failed_line = function(exception, example) { var $a, self = this, matching_line = nil, file_path = nil, line_number = nil; try { if ((($a = matching_line = self.$find_failed_line(exception.$backtrace(), example.$file_path())) !== nil && (!$a.$$is_boolean || $a == true))) { } else { return "Unable to find matching line from backtrace" }; $a = $opal.to_ary(matching_line.$match(/(.+?):(\d+)(|:\d+)/)['$[]']($range(1, 2, false))), file_path = ($a[0] == null ? nil : $a[0]), line_number = ($a[1] == null ? nil : $a[1]); if ((($a = $scope.get('File')['$exist?'](file_path)) !== nil && (!$a.$$is_boolean || $a == true))) { return ((($a = $scope.get('File').$readlines(file_path)['$[]'](line_number.$to_i()['$-'](1))) !== false && $a !== nil) ? $a : "Unable to find matching line in " + (file_path)) } else { return "Unable to find " + (file_path) + " to read failed line" }; } catch ($err) {if ($opal.$rescue($err, [$scope.get('SecurityError')])) { return "Unable to read failed line" }else { throw $err; } }; }; def.$find_failed_line = function(backtrace, path) { var $a, $b, TMP_1, self = this; path = $scope.get('File').$expand_path(path); return ($a = ($b = backtrace).$detect, $a.$$p = (TMP_1 = function(line){var self = TMP_1.$$s || this, $a, match = nil; if (line == null) line = nil; match = line.$match(/(.+?):(\d+)(|:\d+)/); return (($a = match !== false && match !== nil) ? match['$[]'](1).$downcase()['$=='](path.$downcase()) : $a);}, TMP_1.$$s = self, TMP_1), $a).call($b); }; def.$start_sync_output = function() { var $a, self = this; if ((($a = self.$output_supports_sync()) !== nil && (!$a.$$is_boolean || $a == true))) { return $a = [self.$output().$sync(), true], self.old_sync = $a[0], self.$output()['$sync=']($a[1]) } else { return nil }; }; def.$restore_sync_output = function() { var $a, $b, self = this; if ((($a = ($b = self.$output_supports_sync(), $b !== false && $b !== nil ?self.$output()['$closed?']()['$!']() : $b)) !== nil && (!$a.$$is_boolean || $a == true))) { return (($a = [self.old_sync]), $b = self.$output(), $b['$sync='].apply($b, $a), $a[$a.length-1]) } else { return nil }; }; def.$output_supports_sync = function() { var self = this; return self.$output()['$respond_to?']("sync="); }; def['$profile_examples?'] = function() { var self = this; return self.$configuration().$profile_examples(); }; def['$fail_fast?'] = function() { var self = this; return self.$configuration().$fail_fast(); }; def['$color_enabled?'] = function() { var self = this; return self.$configuration()['$color_enabled?'](self.$output()); }; def['$mute_profile_output?'] = function(failure_count) { var $a, $b, self = this; return ((($a = self['$profile_examples?']()['$!']()) !== false && $a !== nil) ? $a : (($b = self['$fail_fast?'](), $b !== false && $b !== nil ?failure_count['$=='](0)['$!']() : $b))); }; def.$slowest_examples = function() { var $a, $b, TMP_2, $c, $d, TMP_3, self = this, number_of_examples = nil, sorted_examples = nil, total = nil, slows = nil; number_of_examples = $scope.get('RSpec').$configuration().$profile_examples(); sorted_examples = ($a = ($b = self.$examples()).$sort_by, $a.$$p = (TMP_2 = function(example){var self = TMP_2.$$s || this; if (example == null) example = nil; return example.$execution_result()['$[]']("run_time")}, TMP_2.$$s = self, TMP_2), $a).call($b).$reverse().$first(number_of_examples); $a = $opal.to_ary(($c = ($d = [self.$examples(), sorted_examples]).$map, $c.$$p = (TMP_3 = function(exs){var self = TMP_3.$$s || this, $a, $b, TMP_4; if (exs == null) exs = nil; return ($a = ($b = exs).$inject, $a.$$p = (TMP_4 = function(i, e){var self = TMP_4.$$s || this; if (i == null) i = nil;if (e == null) e = nil; return i['$+'](e.$execution_result()['$[]']("run_time"))}, TMP_4.$$s = self, TMP_4), $a).call($b, 0.0)}, TMP_3.$$s = self, TMP_3), $c).call($d)), total = ($a[0] == null ? nil : $a[0]), slows = ($a[1] == null ? nil : $a[1]); return $hash2(["examples", "total", "slows"], {"examples": sorted_examples, "total": total, "slows": slows}); }; return (def.$slowest_groups = function() { var $a, $b, TMP_5, $c, TMP_6, $d, TMP_7, self = this, number_of_examples = nil, example_groups = nil; number_of_examples = $scope.get('RSpec').$configuration().$profile_examples(); example_groups = $hash2([], {}); ($a = ($b = self.$examples()).$each, $a.$$p = (TMP_5 = function(example){var self = TMP_5.$$s || this, $a, $b, $c, location = nil; if (example == null) example = nil; location = example.$example_group().$parent_groups().$last().$metadata()['$[]']("example_group")['$[]']("location"); ($a = location, $b = example_groups, ((($c = $b['$[]']($a)) !== false && $c !== nil) ? $c : $b['$[]=']($a, $scope.get('Hash').$new(0)))); ($a = "total_time", $b = example_groups['$[]'](location), $b['$[]=']($a, $b['$[]']($a)['$+'](example.$execution_result()['$[]']("run_time")))); ($a = "count", $b = example_groups['$[]'](location), $b['$[]=']($a, $b['$[]']($a)['$+'](1))); if ((($a = example_groups['$[]'](location)['$has_key?']("description")) !== nil && (!$a.$$is_boolean || $a == true))) { return nil } else { return example_groups['$[]'](location)['$[]=']("description", example.$example_group().$top_level_description()) };}, TMP_5.$$s = self, TMP_5), $a).call($b); if (example_groups.$keys().$length()['$<='](1)) { return $hash2([], {})}; ($a = ($c = example_groups).$each_value, $a.$$p = (TMP_6 = function(hash){var self = TMP_6.$$s || this; if (hash == null) hash = nil; return hash['$[]=']("average", hash['$[]']("total_time").$to_f()['$/'](hash['$[]']("count")))}, TMP_6.$$s = self, TMP_6), $a).call($c); return ($a = ($d = example_groups).$sort_by, $a.$$p = (TMP_7 = function(_, hash){var self = TMP_7.$$s || this; if (_ == null) _ = nil;if (hash == null) hash = nil; return hash['$[]']("average")['$-@']()}, TMP_7.$$s = self, TMP_7), $a).call($d).$first(number_of_examples); }, nil) && 'slowest_groups'; })(self, null) })(self) })(self) })(self); }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/core/formatters/base_text_formatter"] = function($opal) { $opal.dynamic_require_severity = "warning"; var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass, $gvars = $opal.gvars, $hash2 = $opal.hash2; $opal.add_stubs(['$require', '$puts', '$output', '$empty?', '$failed_examples', '$each_with_index', '$pending_fixed?', '$dump_pending_fixed', '$dump_failure', '$dump_backtrace', '$>', '$failure_count', '$color', '$failure_color', '$configuration', '$pending_count', '$pending_color', '$success_color', '$mute_profile_output?', '$dump_profile', '$format_duration', '$colorise_summary', '$summary_line', '$dump_commands_to_rerun_failed_examples', '$each', '$+', '$relative_path', '$location', '$detail_color', '$full_description', '$dump_profile_slowest_examples', '$dump_profile_slowest_example_groups', '$slowest_examples', '$/', '$[]', '$%', '$*', '$nan?', '$size', '$format_seconds', '$bold', '$execution_result', '$format_caller', '$slowest_groups', '$pluralize', '$<<', '$pending_examples', '$show_failures_in_pending_blocks?', '$dump_failure_info', '$===', '$!', '$==', '$close', '$to_set', '$values', '$include?', '$fetch', '$color_code_for', '$protected', '$color_enabled?', '$colorize', '$fixed_color', '$default_color', '$deprecate', '$private', '$backtrace_line', '$backtrace_formatter', '$first', '$split', '$to_s', '$long_padding', '$format_backtrace', '$backtrace', '$short_padding', '$next', '$metadata', '$exception_class_name_for', '$strip', '$read_failed_line', '$=~', '$message', '$find_shared_group', '$dump_shared_failure_info', '$name', '$class', '$find', '$group_and_parent_groups', '$parent_groups', '$example_group']); self.$require("rspec/core/formatters/base_formatter"); self.$require("set"); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Core'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Formatters'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $BaseTextFormatter(){}; var self = $BaseTextFormatter = $klass($base, $super, 'BaseTextFormatter', $BaseTextFormatter); var def = self.$$proto, $scope = self.$$scope, TMP_2; def.$message = function(message) { var self = this; return self.$output().$puts(message); }; def.$dump_failures = function() { var $a, $b, TMP_1, self = this; if ((($a = self.$failed_examples()['$empty?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return nil}; self.$output().$puts(); self.$output().$puts("Failures:"); return ($a = ($b = self.$failed_examples()).$each_with_index, $a.$$p = (TMP_1 = function(example, index){var self = TMP_1.$$s || this, $a; if (example == null) example = nil;if (index == null) index = nil; self.$output().$puts(); if ((($a = self['$pending_fixed?'](example)) !== nil && (!$a.$$is_boolean || $a == true))) { self.$dump_pending_fixed(example, index) } else { self.$dump_failure(example, index) }; return self.$dump_backtrace(example);}, TMP_1.$$s = self, TMP_1), $a).call($b); }; def.$colorise_summary = function(summary) { var self = this; if (self.$failure_count()['$>'](0)) { return self.$color(summary, $scope.get('RSpec').$configuration().$failure_color()) } else if (self.$pending_count()['$>'](0)) { return self.$color(summary, $scope.get('RSpec').$configuration().$pending_color()) } else { return self.$color(summary, $scope.get('RSpec').$configuration().$success_color()) }; }; def.$dump_summary = TMP_2 = function(duration, example_count, failure_count, pending_count) { var $a, self = this, $iter = TMP_2.$$p, $yield = $iter || nil; TMP_2.$$p = null; $opal.find_super_dispatcher(self, 'dump_summary', TMP_2, null).apply(self, [duration, example_count, failure_count, pending_count]); if ((($a = self['$mute_profile_output?'](failure_count)) !== nil && (!$a.$$is_boolean || $a == true))) { } else { self.$dump_profile() }; self.$output().$puts("\nFinished in " + (self.$format_duration(duration)) + "\n"); self.$output().$puts(self.$colorise_summary(self.$summary_line(example_count, failure_count, pending_count))); return self.$dump_commands_to_rerun_failed_examples(); }; def.$dump_commands_to_rerun_failed_examples = function() { var $a, $b, TMP_3, self = this; if ((($a = self.$failed_examples()['$empty?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return nil}; self.$output().$puts(); self.$output().$puts("Failed examples:"); self.$output().$puts(); return ($a = ($b = self.$failed_examples()).$each, $a.$$p = (TMP_3 = function(example){var self = TMP_3.$$s || this; if (example == null) example = nil; return self.$output().$puts(self.$failure_color("rspec " + ((((($scope.get('RSpec')).$$scope.get('Core'))).$$scope.get('Metadata')).$relative_path(example.$location())))['$+'](" ")['$+'](self.$detail_color("# " + (example.$full_description()))))}, TMP_3.$$s = self, TMP_3), $a).call($b); }; def.$dump_profile = function() { var self = this; self.$dump_profile_slowest_examples(); return self.$dump_profile_slowest_example_groups(); }; def.$dump_profile_slowest_examples = function() { var $a, $b, TMP_4, self = this, sorted_examples = nil, time_taken = nil, percentage = nil; sorted_examples = self.$slowest_examples(); time_taken = sorted_examples['$[]']("slows")['$/'](sorted_examples['$[]']("total")); percentage = "%.1f"['$%']((((function() {if ((($a = time_taken['$nan?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return 0.0 } else { return time_taken }; return nil; })())['$*'](100))); self.$output().$puts("\nTop " + (sorted_examples['$[]']("examples").$size()) + " slowest examples (" + (self.$format_seconds(sorted_examples['$[]']("slows"))) + " seconds, " + (percentage) + "% of total time):\n"); return ($a = ($b = sorted_examples['$[]']("examples")).$each, $a.$$p = (TMP_4 = function(example){var self = TMP_4.$$s || this; if (example == null) example = nil; self.$output().$puts(" " + (example.$full_description())); return self.$output().$puts(" " + (self.$bold(self.$format_seconds(example.$execution_result()['$[]']("run_time")))) + " " + (self.$bold("seconds")) + " " + (self.$format_caller(example.$location())));}, TMP_4.$$s = self, TMP_4), $a).call($b); }; def.$dump_profile_slowest_example_groups = function() { var $a, $b, TMP_5, self = this, sorted_groups = nil; sorted_groups = self.$slowest_groups(); if ((($a = sorted_groups['$empty?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return nil}; self.$output().$puts("\nTop " + (sorted_groups.$size()) + " slowest example groups:"); return ($a = ($b = self.$slowest_groups()).$each, $a.$$p = (TMP_5 = function(loc, hash){var self = TMP_5.$$s || this, average = nil, total = nil, count = nil; if (loc == null) loc = nil;if (hash == null) hash = nil; average = "" + (self.$bold(self.$format_seconds(hash['$[]']("average")))) + " " + (self.$bold("seconds")) + " average"; total = "" + (self.$format_seconds(hash['$[]']("total_time"))) + " seconds"; count = self.$pluralize(hash['$[]']("count"), "example"); self.$output().$puts(" " + (hash['$[]']("description"))); return self.$output().$puts(" " + (average) + " (" + (total) + " / " + (count) + ") " + (loc));}, TMP_5.$$s = self, TMP_5), $a).call($b); }; def.$summary_line = function(example_count, failure_count, pending_count) { var self = this, summary = nil; summary = self.$pluralize(example_count, "example"); summary['$<<'](", ")['$<<'](self.$pluralize(failure_count, "failure")); if (pending_count['$>'](0)) { summary['$<<'](", " + (pending_count) + " pending")}; return summary; }; def.$dump_pending = function() { var $a, $b, TMP_6, self = this; if ((($a = self.$pending_examples()['$empty?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return nil } else { self.$output().$puts(); self.$output().$puts("Pending:"); return ($a = ($b = self.$pending_examples()).$each, $a.$$p = (TMP_6 = function(pending_example){var self = TMP_6.$$s || this, $a, $b; if (pending_example == null) pending_example = nil; self.$output().$puts(self.$pending_color(" " + (pending_example.$full_description()))); self.$output().$puts(self.$detail_color(" # " + (pending_example.$execution_result()['$[]']("pending_message")))); self.$output().$puts(self.$detail_color(" # " + (self.$format_caller(pending_example.$location())))); if ((($a = ($b = pending_example.$execution_result()['$[]']("exception"), $b !== false && $b !== nil ?$scope.get('RSpec').$configuration()['$show_failures_in_pending_blocks?']() : $b)) !== nil && (!$a.$$is_boolean || $a == true))) { self.$dump_failure_info(pending_example); return self.$dump_backtrace(pending_example); } else { return nil };}, TMP_6.$$s = self, TMP_6), $a).call($b); }; }; def.$seed = function(number) { var self = this; self.$output().$puts(); self.$output().$puts("Randomized with seed " + (number)); return self.$output().$puts(); }; def.$close = function() { var $a, $b, self = this; if ($gvars.stdout == null) $gvars.stdout = nil; if ((($a = ($b = $scope.get('IO')['$==='](self.$output()), $b !== false && $b !== nil ?self.$output()['$==']($gvars.stdout)['$!']() : $b)) !== nil && (!$a.$$is_boolean || $a == true))) { return self.$output().$close() } else { return nil }; }; $opal.cdecl($scope, 'VT100_COLORS', $hash2(["black", "red", "green", "yellow", "blue", "magenta", "cyan", "white"], {"black": 30, "red": 31, "green": 32, "yellow": 33, "blue": 34, "magenta": 35, "cyan": 36, "white": 37})); $opal.cdecl($scope, 'VT100_COLOR_CODES', $scope.get('VT100_COLORS').$values().$to_set()); def.$color_code_for = function(code_or_symbol) { var $a, $b, TMP_7, self = this; if ((($a = $scope.get('VT100_COLOR_CODES')['$include?'](code_or_symbol)) !== nil && (!$a.$$is_boolean || $a == true))) { return code_or_symbol } else { return ($a = ($b = $scope.get('VT100_COLORS')).$fetch, $a.$$p = (TMP_7 = function(){var self = TMP_7.$$s || this; return self.$color_code_for("white")}, TMP_7.$$s = self, TMP_7), $a).call($b, code_or_symbol) }; }; def.$colorize = function(text, code_or_symbol) { var self = this; return "\e[" + (self.$color_code_for(code_or_symbol)) + "m" + (text) + "\e[0m"; }; self.$protected(); def.$bold = function(text) { var $a, self = this; if ((($a = self['$color_enabled?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return "\e[1m" + (text) + "\e[0m" } else { return text }; }; def.$color = function(text, color_code) { var $a, self = this; if ((($a = self['$color_enabled?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return self.$colorize(text, color_code) } else { return text }; }; def.$failure_color = function(text) { var self = this; return self.$color(text, $scope.get('RSpec').$configuration().$failure_color()); }; def.$success_color = function(text) { var self = this; return self.$color(text, $scope.get('RSpec').$configuration().$success_color()); }; def.$pending_color = function(text) { var self = this; return self.$color(text, $scope.get('RSpec').$configuration().$pending_color()); }; def.$fixed_color = function(text) { var self = this; return self.$color(text, $scope.get('RSpec').$configuration().$fixed_color()); }; def.$detail_color = function(text) { var self = this; return self.$color(text, $scope.get('RSpec').$configuration().$detail_color()); }; def.$default_color = function(text) { var self = this; return self.$color(text, $scope.get('RSpec').$configuration().$default_color()); }; def.$red = function(text) { var self = this; $scope.get('RSpec').$deprecate("RSpec::Core::Formatters::BaseTextFormatter#red", $hash2(["replacement"], {"replacement": "#failure_color"})); return self.$color(text, "red"); }; def.$green = function(text) { var self = this; $scope.get('RSpec').$deprecate("RSpec::Core::Formatters::BaseTextFormatter#green", $hash2(["replacement"], {"replacement": "#success_color"})); return self.$color(text, "green"); }; def.$yellow = function(text) { var self = this; $scope.get('RSpec').$deprecate("RSpec::Core::Formatters::BaseTextFormatter#yellow", $hash2(["replacement"], {"replacement": "#pending_color"})); return self.$color(text, "yellow"); }; def.$blue = function(text) { var self = this; $scope.get('RSpec').$deprecate("RSpec::Core::Formatters::BaseTextFormatter#blue", $hash2(["replacement"], {"replacement": "#fixed_color"})); return self.$color(text, "blue"); }; def.$magenta = function(text) { var self = this; $scope.get('RSpec').$deprecate("RSpec::Core::Formatters::BaseTextFormatter#magenta"); return self.$color(text, "magenta"); }; def.$cyan = function(text) { var self = this; $scope.get('RSpec').$deprecate("RSpec::Core::Formatters::BaseTextFormatter#cyan", $hash2(["replacement"], {"replacement": "#detail_color"})); return self.$color(text, "cyan"); }; def.$white = function(text) { var self = this; $scope.get('RSpec').$deprecate("RSpec::Core::Formatters::BaseTextFormatter#white", $hash2(["replacement"], {"replacement": "#default_color"})); return self.$color(text, "white"); }; def.$short_padding = function() { var self = this; return " "; }; def.$long_padding = function() { var self = this; return " "; }; self.$private(); def.$format_caller = function(caller_info) { var self = this; return self.$configuration().$backtrace_formatter().$backtrace_line(caller_info.$to_s().$split(":in `block").$first()); }; def.$dump_backtrace = function(example) { var $a, $b, TMP_8, self = this; return ($a = ($b = self.$format_backtrace(example.$execution_result()['$[]']("exception").$backtrace(), example)).$each, $a.$$p = (TMP_8 = function(backtrace_info){var self = TMP_8.$$s || this; if (backtrace_info == null) backtrace_info = nil; return self.$output().$puts(self.$detail_color("" + (self.$long_padding()) + "# " + (backtrace_info)))}, TMP_8.$$s = self, TMP_8), $a).call($b); }; def.$dump_pending_fixed = function(example, index) { var self = this; self.$output().$puts("" + (self.$short_padding()) + (index.$next()) + ") " + (example.$full_description()) + " FIXED"); return self.$output().$puts(self.$fixed_color("" + (self.$long_padding()) + "Expected pending '" + (example.$metadata()['$[]']("execution_result")['$[]']("pending_message")) + "' to fail. No Error was raised.")); }; def['$pending_fixed?'] = function(example) { var self = this; return example.$execution_result()['$[]']("pending_fixed"); }; def.$dump_failure = function(example, index) { var self = this; self.$output().$puts("" + (self.$short_padding()) + (index.$next()) + ") " + (example.$full_description())); return self.$dump_failure_info(example); }; def.$dump_failure_info = function(example) { var $a, $b, TMP_9, self = this, exception = nil, exception_class_name = nil, shared_group = nil; exception = example.$execution_result()['$[]']("exception"); exception_class_name = self.$exception_class_name_for(exception); self.$output().$puts("" + (self.$long_padding()) + (self.$failure_color("Failure/Error:")) + " " + (self.$failure_color(self.$read_failed_line(exception, example).$strip()))); if ((($a = exception_class_name['$=~'](/RSpec/)) !== nil && (!$a.$$is_boolean || $a == true))) { } else { self.$output().$puts("" + (self.$long_padding()) + (self.$failure_color(exception_class_name)) + ":") }; if ((($a = exception.$message()) !== nil && (!$a.$$is_boolean || $a == true))) { ($a = ($b = exception.$message().$to_s().$split("\n")).$each, $a.$$p = (TMP_9 = function(line){var self = TMP_9.$$s || this; if (line == null) line = nil; return self.$output().$puts("" + (self.$long_padding()) + " " + (self.$failure_color(line)))}, TMP_9.$$s = self, TMP_9), $a).call($b)}; if ((($a = shared_group = self.$find_shared_group(example)) !== nil && (!$a.$$is_boolean || $a == true))) { return self.$dump_shared_failure_info(shared_group) } else { return nil }; }; def.$exception_class_name_for = function(exception) { var self = this, name = nil; name = exception.$class().$name().$to_s(); if (name['$==']("")) { name = "(anonymous error class)"}; return name; }; def.$dump_shared_failure_info = function(group) { var self = this; return self.$output().$puts(((((("") + (self.$long_padding())) + "Shared Example Group: \"") + (group.$metadata()['$[]']("shared_group_name"))) + "\" called from ")['$+']("" + (self.$configuration().$backtrace_formatter().$backtrace_line(group.$metadata()['$[]']("example_group")['$[]']("location"))))); }; def.$find_shared_group = function(example) { var $a, $b, TMP_10, self = this; return ($a = ($b = self.$group_and_parent_groups(example)).$find, $a.$$p = (TMP_10 = function(group){var self = TMP_10.$$s || this; if (group == null) group = nil; return group.$metadata()['$[]']("shared_group_name")}, TMP_10.$$s = self, TMP_10), $a).call($b); }; return (def.$group_and_parent_groups = function(example) { var self = this; return example.$example_group().$parent_groups()['$+']([example.$example_group()]); }, nil) && 'group_and_parent_groups'; })(self, $scope.get('BaseFormatter')) })(self) })(self) })(self); }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/core/formatters/deprecation_formatter"] = function($opal) { $opal.dynamic_require_severity = "warning"; var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass; $opal.add_stubs(['$require', '$attr_reader', '$new', '$deprecation_stream', '$===', '$summary_stream', '$include?', '$+', '$print_deprecation_message', '$printer', '$<<', '$deprecation_summary', '$[]', '$gsub', '$deprecation_type_for', '$private', '$type', '$include', '$sync=', '$deprecation_message_for', '$deprecation_formatter', '$puts', '$to_s', '$>', '$count', '$pluralize', '$path', '$[]=', '$stash_deprecation_message', '$<', '$==', '$too_many_warnings_message', '$any?', '$print_deferred_deprecation_warnings', '$each', '$sort_by', '$to_proc', '$keys', '$raise']); self.$require("rspec/core/formatters/helpers"); self.$require("set"); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Core'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Formatters'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $DeprecationFormatter(){}; var self = $DeprecationFormatter = $klass($base, $super, 'DeprecationFormatter', $DeprecationFormatter); var def = self.$$proto, $scope = self.$$scope, $a, $b, TMP_1, $c, TMP_3; def.printer = def.seen_deprecations = def.count = nil; self.$attr_reader("count", "deprecation_stream", "summary_stream"); def.$initialize = function(deprecation_stream, summary_stream) { var self = this; self.deprecation_stream = deprecation_stream; self.summary_stream = summary_stream; self.seen_deprecations = $scope.get('Set').$new(); return self.count = 0; }; def.$printer = function() { var $a, self = this, $case = nil; return ((($a = self.printer) !== false && $a !== nil) ? $a : self.printer = (function() {$case = self.$deprecation_stream();if ($scope.get('File')['$===']($case) || $scope.get('RaiseErrorStream')['$===']($case)) {return $scope.get('ImmediatePrinter').$new(self.$deprecation_stream(), self.$summary_stream(), self)}else {return $scope.get('DelayedPrinter').$new(self.$deprecation_stream(), self.$summary_stream(), self)}})()); }; def.$deprecation = function(data) { var $a, self = this; if ((($a = self.seen_deprecations['$include?'](data)) !== nil && (!$a.$$is_boolean || $a == true))) { return nil}; self.count = self.count['$+'](1); self.$printer().$print_deprecation_message(data); return self.seen_deprecations['$<<'](data); }; def.$deprecation_summary = function() { var self = this; return self.$printer().$deprecation_summary(); }; def.$deprecation_message_for = function(data) { var $a, self = this; if ((($a = data['$[]']("message")) !== nil && (!$a.$$is_boolean || $a == true))) { return $scope.get('SpecifiedDeprecationMessage').$new(data) } else { return $scope.get('GeneratedDeprecationMessage').$new(data) }; }; $opal.cdecl($scope, 'RAISE_ERROR_CONFIG_NOTICE', " |\n |If you need more of the backtrace for any of these deprecations to\n |identify where to make the necessary changes, you can configure\n |`config.raise_errors_for_deprecations!`, and it will turn the\n |deprecation warnings into errors, giving you the full backtrace.\n".$gsub(/^\s+\|/, "")); $opal.cdecl($scope, 'SpecifiedDeprecationMessage', ($a = ($b = $scope.get('Struct')).$new, $a.$$p = (TMP_1 = function(){var self = TMP_1.$$s || this, TMP_2; $opal.defn(self, '$initialize', TMP_2 = function(data) { var self = this, $iter = TMP_2.$$p, $yield = $iter || nil; TMP_2.$$p = null; self.message = data['$[]']("message"); return $opal.find_super_dispatcher(self, 'initialize', TMP_2, null).apply(self, [self.$deprecation_type_for(data)]); }); $opal.defn(self, '$to_s', function() { var self = this; if (self.message == null) self.message = nil; return self.message; }); $opal.defn(self, '$too_many_warnings_message', function() { var self = this, msg = nil; msg = "Too many similar deprecation messages reported, disregarding further reports."; msg['$<<'](" Set config.deprecation_stream to a File for full output."); return msg; }); self.$private(); return ($opal.defn(self, '$deprecation_type_for', function(data) { var self = this; return data['$[]']("message").$gsub(/(\w+\/)+\w+\.rb:\d+/, ""); }), nil) && 'deprecation_type_for';}, TMP_1.$$s = self, TMP_1), $a).call($b, "type")); $opal.cdecl($scope, 'GeneratedDeprecationMessage', ($a = ($c = $scope.get('Struct')).$new, $a.$$p = (TMP_3 = function(){var self = TMP_3.$$s || this, TMP_4; $opal.defn(self, '$initialize', TMP_4 = function(data) { var self = this, $iter = TMP_4.$$p, $yield = $iter || nil; TMP_4.$$p = null; self.data = data; return $opal.find_super_dispatcher(self, 'initialize', TMP_4, null).apply(self, [data['$[]']("deprecated")]); }); $opal.defn(self, '$to_s', function() { var $a, self = this, msg = nil; if (self.data == null) self.data = nil; msg = "" + (self.data['$[]']("deprecated")) + " is deprecated."; if ((($a = self.data['$[]']("replacement")) !== nil && (!$a.$$is_boolean || $a == true))) { msg['$<<'](" Use " + (self.data['$[]']("replacement")) + " instead.")}; if ((($a = self.data['$[]']("call_site")) !== nil && (!$a.$$is_boolean || $a == true))) { msg['$<<'](" Called from " + (self.data['$[]']("call_site")) + ".")}; return msg; }); return ($opal.defn(self, '$too_many_warnings_message', function() { var self = this, msg = nil; msg = "Too many uses of deprecated '" + (self.$type()) + "'."; msg['$<<'](" Set config.deprecation_stream to a File for full output."); return msg; }), nil) && 'too_many_warnings_message';}, TMP_3.$$s = self, TMP_3), $a).call($c, "type")); (function($base, $super) { function $ImmediatePrinter(){}; var self = $ImmediatePrinter = $klass($base, $super, 'ImmediatePrinter', $ImmediatePrinter); var def = self.$$proto, $scope = self.$$scope; def.deprecation_stream = nil; self.$include(((((((Opal.get('RSpec')).$$scope.get('Core'))).$$scope.get('Formatters'))).$$scope.get('Helpers'))); self.$attr_reader("deprecation_stream", "summary_stream", "deprecation_formatter"); def.$initialize = function(deprecation_stream, summary_stream, deprecation_formatter) { var $a, $b, self = this; self.deprecation_stream = deprecation_stream; (($a = [true]), $b = self.deprecation_stream, $b['$sync='].apply($b, $a), $a[$a.length-1]); self.summary_stream = summary_stream; return self.deprecation_formatter = deprecation_formatter; }; def.$print_deprecation_message = function(data) { var self = this, deprecation_message = nil; deprecation_message = self.$deprecation_formatter().$deprecation_message_for(data); return self.$deprecation_stream().$puts(deprecation_message.$to_s()); }; return (def.$deprecation_summary = function() { var self = this; if (self.$deprecation_formatter().$count()['$>'](0)) { self.$summary_stream().$puts("\n" + (self.$pluralize(self.$deprecation_formatter().$count(), "deprecation")) + " logged to " + (self.$deprecation_stream().$path())); return self.$deprecation_stream().$puts($scope.get('RAISE_ERROR_CONFIG_NOTICE')); } else { return nil }; }, nil) && 'deprecation_summary'; })(self, null); (function($base, $super) { function $DelayedPrinter(){}; var self = $DelayedPrinter = $klass($base, $super, 'DelayedPrinter', $DelayedPrinter); var def = self.$$proto, $scope = self.$$scope; def.seen_deprecations = def.deprecation_messages = nil; $opal.cdecl($scope, 'TOO_MANY_USES_LIMIT', 4); self.$include(((((((Opal.get('RSpec')).$$scope.get('Core'))).$$scope.get('Formatters'))).$$scope.get('Helpers'))); self.$attr_reader("deprecation_stream", "summary_stream", "deprecation_formatter"); def.$initialize = function(deprecation_stream, summary_stream, deprecation_formatter) { var $a, $b, TMP_5, $c, TMP_6, self = this; self.deprecation_stream = deprecation_stream; self.summary_stream = summary_stream; self.deprecation_formatter = deprecation_formatter; self.seen_deprecations = ($a = ($b = $scope.get('Hash')).$new, $a.$$p = (TMP_5 = function(){var self = TMP_5.$$s || this; return 0}, TMP_5.$$s = self, TMP_5), $a).call($b); return self.deprecation_messages = ($a = ($c = $scope.get('Hash')).$new, $a.$$p = (TMP_6 = function(h, k){var self = TMP_6.$$s || this; if (h == null) h = nil;if (k == null) k = nil; return h['$[]='](k, [])}, TMP_6.$$s = self, TMP_6), $a).call($c); }; def.$print_deprecation_message = function(data) { var $a, $b, self = this, deprecation_message = nil; deprecation_message = self.$deprecation_formatter().$deprecation_message_for(data); ($a = deprecation_message, $b = self.seen_deprecations, $b['$[]=']($a, $b['$[]']($a)['$+'](1))); return self.$stash_deprecation_message(deprecation_message); }; def.$stash_deprecation_message = function(deprecation_message) { var self = this; if (self.seen_deprecations['$[]'](deprecation_message)['$<']($scope.get('TOO_MANY_USES_LIMIT'))) { return self.deprecation_messages['$[]'](deprecation_message)['$<<'](deprecation_message.$to_s()) } else if (self.seen_deprecations['$[]'](deprecation_message)['$==']($scope.get('TOO_MANY_USES_LIMIT'))) { return self.deprecation_messages['$[]'](deprecation_message)['$<<'](deprecation_message.$too_many_warnings_message()) } else { return nil }; }; def.$deprecation_summary = function() { var $a, self = this; if ((($a = self.deprecation_messages['$any?']()) !== nil && (!$a.$$is_boolean || $a == true))) { } else { return nil }; self.$print_deferred_deprecation_warnings(); self.$deprecation_stream().$puts($scope.get('RAISE_ERROR_CONFIG_NOTICE')); return self.$summary_stream().$puts("\n" + (self.$pluralize(self.$deprecation_formatter().$count(), "deprecation warning")) + " total"); }; return (def.$print_deferred_deprecation_warnings = function() { var $a, $b, TMP_7, $c, $d, self = this; self.$deprecation_stream().$puts("\nDeprecation Warnings:\n\n"); return ($a = ($b = ($c = ($d = self.deprecation_messages.$keys()).$sort_by, $c.$$p = "type".$to_proc(), $c).call($d)).$each, $a.$$p = (TMP_7 = function(deprecation){var self = TMP_7.$$s || this, $a, $b, TMP_8, messages = nil; if (self.deprecation_messages == null) self.deprecation_messages = nil; if (deprecation == null) deprecation = nil; messages = self.deprecation_messages['$[]'](deprecation); ($a = ($b = messages).$each, $a.$$p = (TMP_8 = function(msg){var self = TMP_8.$$s || this; if (msg == null) msg = nil; return self.$deprecation_stream().$puts(msg)}, TMP_8.$$s = self, TMP_8), $a).call($b); return self.$deprecation_stream().$puts();}, TMP_7.$$s = self, TMP_7), $a).call($b); }, nil) && 'print_deferred_deprecation_warnings'; })(self, null); return (function($base, $super) { function $RaiseErrorStream(){}; var self = $RaiseErrorStream = $klass($base, $super, 'RaiseErrorStream', $RaiseErrorStream); var def = self.$$proto, $scope = self.$$scope; def.$puts = function(message) { var self = this; return self.$raise($scope.get('DeprecationError'), message); }; return (def['$sync='] = function(value) { var self = this; return nil; }, nil) && 'sync='; })(self, null); })(self, null) })(self); $opal.cdecl($scope, 'DeprecationError', $scope.get('Class').$new($scope.get('StandardError'))); })(self) })(self); }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/core/formatters/documentation_formatter"] = function($opal) { $opal.dynamic_require_severity = "warning"; var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass; $opal.add_stubs(['$require', '$==', '$puts', '$output', '$current_indentation', '$strip', '$description', '$+', '$-', '$passed_output', '$pending_output', '$[]', '$execution_result', '$failure_output', '$failure_color', '$next_failure_index', '$success_color', '$pending_color', '$*', '$reverse', '$parent_groups', '$example_group']); self.$require("rspec/core/formatters/base_text_formatter"); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Core'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Formatters'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $DocumentationFormatter(){}; var self = $DocumentationFormatter = $klass($base, $super, 'DocumentationFormatter', $DocumentationFormatter); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5; def.group_level = def.next_failure_index = nil; def.$initialize = TMP_1 = function(output) { var self = this, $iter = TMP_1.$$p, $yield = $iter || nil; TMP_1.$$p = null; $opal.find_super_dispatcher(self, 'initialize', TMP_1, null).apply(self, [output]); return self.group_level = 0; }; def.$example_group_started = TMP_2 = function(example_group) { var self = this, $iter = TMP_2.$$p, $yield = $iter || nil; TMP_2.$$p = null; $opal.find_super_dispatcher(self, 'example_group_started', TMP_2, null).apply(self, [example_group]); if (self.group_level['$=='](0)) { self.$output().$puts()}; self.$output().$puts("" + (self.$current_indentation()) + (example_group.$description().$strip())); return self.group_level = self.group_level['$+'](1); }; def.$example_group_finished = function(example_group) { var self = this; return self.group_level = self.group_level['$-'](1); }; def.$example_passed = TMP_3 = function(example) { var self = this, $iter = TMP_3.$$p, $yield = $iter || nil; TMP_3.$$p = null; $opal.find_super_dispatcher(self, 'example_passed', TMP_3, null).apply(self, [example]); return self.$output().$puts(self.$passed_output(example)); }; def.$example_pending = TMP_4 = function(example) { var self = this, $iter = TMP_4.$$p, $yield = $iter || nil; TMP_4.$$p = null; $opal.find_super_dispatcher(self, 'example_pending', TMP_4, null).apply(self, [example]); return self.$output().$puts(self.$pending_output(example, example.$execution_result()['$[]']("pending_message"))); }; def.$example_failed = TMP_5 = function(example) { var self = this, $iter = TMP_5.$$p, $yield = $iter || nil; TMP_5.$$p = null; $opal.find_super_dispatcher(self, 'example_failed', TMP_5, null).apply(self, [example]); return self.$output().$puts(self.$failure_output(example, example.$execution_result()['$[]']("exception"))); }; def.$failure_output = function(example, exception) { var self = this; return self.$failure_color("" + (self.$current_indentation()) + (example.$description().$strip()) + " (FAILED - " + (self.$next_failure_index()) + ")"); }; def.$next_failure_index = function() { var $a, self = this; ((($a = self.next_failure_index) !== false && $a !== nil) ? $a : self.next_failure_index = 0); return self.next_failure_index = self.next_failure_index['$+'](1); }; def.$passed_output = function(example) { var self = this; return self.$success_color("" + (self.$current_indentation()) + (example.$description().$strip())); }; def.$pending_output = function(example, message) { var self = this; return self.$pending_color("" + (self.$current_indentation()) + (example.$description().$strip()) + " (PENDING: " + (message) + ")"); }; def.$current_indentation = function() { var self = this; return " "['$*'](self.group_level); }; return (def.$example_group_chain = function() { var self = this; return self.$example_group().$parent_groups().$reverse(); }, nil) && 'example_group_chain'; })(self, $scope.get('BaseTextFormatter')) })(self) })(self) })(self); }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/core/formatters/helpers"] = function($opal) { $opal.dynamic_require_severity = "warning"; var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module; $opal.add_stubs(['$<', '$>', '$to_i', '$/', '$-', '$*', '$pluralize', '$format_seconds', '$sprintf', '$strip_trailing_zeroes', '$sub', '$empty?', '$==', '$to_f']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Core'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Formatters'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Helpers'); var def = self.$$proto, $scope = self.$$scope; $opal.cdecl($scope, 'SUB_SECOND_PRECISION', 5); $opal.cdecl($scope, 'DEFAULT_PRECISION', 2); def.$format_duration = function(duration) { var self = this, precision = nil, minutes = nil, seconds = nil; precision = (function() {if (duration['$<'](1)) {return $scope.get('SUB_SECOND_PRECISION')}else if (duration['$<'](120)) {return $scope.get('DEFAULT_PRECISION')}else if (duration['$<'](300)) {return 1}else {return 0}})(); if (duration['$>'](60)) { minutes = (duration.$to_i()['$/'](60)).$to_i(); seconds = duration['$-'](minutes['$*'](60)); return "" + (self.$pluralize(minutes, "minute")) + " " + (self.$pluralize(self.$format_seconds(seconds, precision), "second")); } else { return self.$pluralize(self.$format_seconds(duration, precision), "second") }; }; def.$format_seconds = function(float$, precision) { var $a, $b, self = this, formatted = nil; if (precision == null) { precision = nil } ((($a = precision) !== false && $a !== nil) ? $a : precision = (function() {if ((($b = (float$['$<'](1))) !== nil && (!$b.$$is_boolean || $b == true))) { return $scope.get('SUB_SECOND_PRECISION') } else { return $scope.get('DEFAULT_PRECISION') }; return nil; })()); formatted = self.$sprintf("%." + (precision) + "f", float$); return self.$strip_trailing_zeroes(formatted); }; def.$strip_trailing_zeroes = function(string) { var $a, self = this, stripped = nil; stripped = string.$sub(/[^1-9]+$/, ""); if ((($a = stripped['$empty?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return "0" } else { return stripped }; }; def.$pluralize = function(count, string) { var self = this; return "" + (count) + " " + (string) + ((function() {if (count.$to_f()['$=='](1)) { return nil } else { return "s" }; return nil; })()); }; ;$opal.donate(self, ["$format_duration", "$format_seconds", "$strip_trailing_zeroes", "$pluralize"]); })(self) })(self) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/core/formatters/html_formatter"] = function($opal) { $opal.dynamic_require_severity = "warning"; var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass, $hash2 = $opal.hash2; $opal.add_stubs(['$require', '$new', '$private', '$public', '$print_html_start', '$flush', '$+', '$==', '$example_group_number', '$print_example_group_end', '$print_example_group_start', '$description', '$size', '$parent_groups', '$move_progress', '$percent_done', '$print_example_passed', '$[]', '$execution_result', '$make_header_red', '$make_example_group_header_red', '$metadata', '$message', '$join', '$format_backtrace', '$backtrace', '$extra_failure_content', '$print_example_failed', '$make_header_yellow', '$make_example_group_header_yellow', '$print_example_pending', '$map', '$backtrace_line', '$backtrace_formatter', '$configuration', '$compact!', '$snippet', '$>', '$to_f', '$/', '$to_i', '$*', '$example_number', '$print_summary', '$dry_run?']); self.$require("rspec/core/formatters/base_text_formatter"); self.$require("rspec/core/formatters/html_printer"); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Core'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Formatters'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $HtmlFormatter(){}; var self = $HtmlFormatter = $klass($base, $super, 'HtmlFormatter', $HtmlFormatter); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6; def.example_group_number = def.example_number = def.printer = def.header_red = def.example_group_red = def.failed_examples = def.snippet_extractor = def.example_count = nil; def.$initialize = TMP_1 = function(output) { var self = this, $iter = TMP_1.$$p, $yield = $iter || nil; TMP_1.$$p = null; $opal.find_super_dispatcher(self, 'initialize', TMP_1, null).apply(self, [output]); self.example_group_number = 0; self.example_number = 0; self.header_red = nil; return self.printer = $scope.get('HtmlPrinter').$new(output); }; self.$private(); def.$method_missing = TMP_2 = function(m, a) { var self = this, $iter = TMP_2.$$p, b = $iter || nil; a = $slice.call(arguments, 1); TMP_2.$$p = null; return nil; }; self.$public(); def.$message = function(message) { var self = this; return nil; }; def.$example_group_number = function() { var self = this; return self.example_group_number; }; def.$example_number = function() { var self = this; return self.example_number; }; def.$start = TMP_3 = function(example_count) { var self = this, $iter = TMP_3.$$p, $yield = $iter || nil; TMP_3.$$p = null; $opal.find_super_dispatcher(self, 'start', TMP_3, null).apply(self, [example_count]); self.printer.$print_html_start(); return self.printer.$flush(); }; def.$example_group_started = TMP_4 = function(example_group) { var self = this, $iter = TMP_4.$$p, $yield = $iter || nil; TMP_4.$$p = null; $opal.find_super_dispatcher(self, 'example_group_started', TMP_4, null).apply(self, [example_group]); self.example_group_red = false; self.example_group_number = self.example_group_number['$+'](1); if (self.$example_group_number()['$=='](1)) { } else { self.printer.$print_example_group_end() }; self.printer.$print_example_group_start(self.$example_group_number(), example_group.$description(), example_group.$parent_groups().$size()); return self.printer.$flush(); }; def.$start_dump = function() { var self = this; self.printer.$print_example_group_end(); return self.printer.$flush(); }; def.$example_started = TMP_5 = function(example) { var self = this, $iter = TMP_5.$$p, $yield = $iter || nil; TMP_5.$$p = null; $opal.find_super_dispatcher(self, 'example_started', TMP_5, null).apply(self, [example]); return self.example_number = self.example_number['$+'](1); }; def.$example_passed = function(example) { var self = this; self.printer.$move_progress(self.$percent_done()); self.printer.$print_example_passed(example.$description(), example.$execution_result()['$[]']("run_time")); return self.printer.$flush(); }; def.$example_failed = TMP_6 = function(example) { var $a, self = this, $iter = TMP_6.$$p, $yield = $iter || nil, exception = nil, exception_details = nil, extra = nil; TMP_6.$$p = null; $opal.find_super_dispatcher(self, 'example_failed', TMP_6, null).apply(self, [example]); if ((($a = self.header_red) !== nil && (!$a.$$is_boolean || $a == true))) { } else { self.header_red = true; self.printer.$make_header_red(); }; if ((($a = self.example_group_red) !== nil && (!$a.$$is_boolean || $a == true))) { } else { self.example_group_red = true; self.printer.$make_example_group_header_red(self.$example_group_number()); }; self.printer.$move_progress(self.$percent_done()); exception = example.$metadata()['$[]']("execution_result")['$[]']("exception"); exception_details = (function() {if (exception !== false && exception !== nil) { return $hash2(["message", "backtrace"], {"message": exception.$message(), "backtrace": self.$format_backtrace(exception.$backtrace(), example).$join("\n")}) } else { return false }; return nil; })(); extra = self.$extra_failure_content(exception); self.printer.$print_example_failed(example.$execution_result()['$[]']("pending_fixed"), example.$description(), example.$execution_result()['$[]']("run_time"), self.failed_examples.$size(), exception_details, (function() {if ((($a = (extra['$=='](""))) !== nil && (!$a.$$is_boolean || $a == true))) { return false } else { return extra }; return nil; })(), true); return self.printer.$flush(); }; def.$example_pending = function(example) { var $a, self = this; if ((($a = self.header_red) !== nil && (!$a.$$is_boolean || $a == true))) { } else { self.printer.$make_header_yellow() }; if ((($a = self.example_group_red) !== nil && (!$a.$$is_boolean || $a == true))) { } else { self.printer.$make_example_group_header_yellow(self.$example_group_number()) }; self.printer.$move_progress(self.$percent_done()); self.printer.$print_example_pending(example.$description(), example.$metadata()['$[]']("execution_result")['$[]']("pending_message")); return self.printer.$flush(); }; def.$extra_failure_content = function(exception) { var $a, $b, TMP_7, self = this, backtrace = nil; self.$require("rspec/core/formatters/snippet_extractor"); backtrace = ($a = ($b = exception.$backtrace()).$map, $a.$$p = (TMP_7 = function(line){var self = TMP_7.$$s || this; if (line == null) line = nil; return self.$configuration().$backtrace_formatter().$backtrace_line(line)}, TMP_7.$$s = self, TMP_7), $a).call($b); backtrace['$compact!'](); ((($a = self.snippet_extractor) !== false && $a !== nil) ? $a : self.snippet_extractor = $scope.get('SnippetExtractor').$new()); return "
" + (self.snippet_extractor.$snippet(backtrace)) + "
";
};
def.$percent_done = function() {
var self = this, result = nil;
result = 100.0;
if (self.example_count['$>'](0)) {
result = (((self.$example_number()).$to_f()['$/'](self.example_count.$to_f())['$*'](1000)).$to_i()['$/'](10.0)).$to_f()};
return result;
};
def.$dump_failures = function() {
var self = this;
return nil;
};
def.$dump_pending = function() {
var self = this;
return nil;
};
return (def.$dump_summary = function(duration, example_count, failure_count, pending_count) {
var self = this;
self.printer.$print_summary(self['$dry_run?'](), duration, example_count, failure_count, pending_count);
return self.printer.$flush();
}, nil) && 'dump_summary';
})(self, $scope.get('BaseTextFormatter'))
})(self)
})(self)
})(self);
};
/* Generated by Opal 0.7.0.dev */
Opal.modules["rspec/core/formatters/html_printer"] = function($opal) {
$opal.dynamic_require_severity = "warning";
var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass;
$opal.add_stubs(['$require', '$include', '$puts', '$indentation_style', '$h', '$sprintf', '$[]', '$==', '$<<', '$>', '$flush', '$private', '$*', '$-']);
self.$require("erb");
return (function($base) {
var self = $module($base, 'RSpec');
var def = self.$$proto, $scope = self.$$scope;
(function($base) {
var self = $module($base, 'Core');
var def = self.$$proto, $scope = self.$$scope;
(function($base) {
var self = $module($base, 'Formatters');
var def = self.$$proto, $scope = self.$$scope;
(function($base, $super) {
function $HtmlPrinter(){};
var self = $HtmlPrinter = $klass($base, $super, 'HtmlPrinter', $HtmlPrinter);
var def = self.$$proto, $scope = self.$$scope;
def.output = nil;
self.$include((($scope.get('ERB')).$$scope.get('Util')));
def.$initialize = function(output) {
var self = this;
return self.output = output;
};
def.$print_html_start = function() {
var self = this;
self.output.$puts($scope.get('HTML_HEADER'));
return self.output.$puts($scope.get('REPORT_HEADER'));
};
def.$print_example_group_end = function() {
var self = this;
self.output.$puts(" ");
return self.output.$puts("");
};
def.$print_example_group_start = function(group_id, description, number_of_parents) {
var self = this;
self.output.$puts("" + (self.$h(exception['$[]']("backtrace"))) + "
" + (exception['$[]']("backtrace")) + "