/* 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.output.$puts("
"); return self.output.$puts("
" + (self.$h(description)) + "
"); }; def.$print_example_passed = function(description, run_time) { var self = this, formatted_run_time = nil; formatted_run_time = self.$sprintf("%.5f", run_time); return self.output.$puts("
" + (self.$h(description)) + "" + (formatted_run_time) + "s
"); }; def.$print_example_failed = function(pending_fixed, description, run_time, failure_id, exception, extra_content, escape_backtrace) { var self = this, formatted_run_time = nil; if (escape_backtrace == null) { escape_backtrace = false } formatted_run_time = self.$sprintf("%.5f", run_time); self.output.$puts("
"); self.output.$puts(" " + (self.$h(description)) + ""); self.output.$puts(" " + (formatted_run_time) + "s"); self.output.$puts("
"); if (exception !== false && exception !== nil) { self.output.$puts("
" + (self.$h(exception['$[]']("message"))) + "
"); if (escape_backtrace !== false && escape_backtrace !== nil) { self.output.$puts("
" + (self.$h(exception['$[]']("backtrace"))) + "
") } else { self.output.$puts("
" + (exception['$[]']("backtrace")) + "
") };}; if (extra_content !== false && extra_content !== nil) { self.output.$puts(extra_content)}; self.output.$puts("
"); return self.output.$puts("
"); }; def.$print_example_pending = function(description, pending_message) { var self = this; return self.output.$puts("
" + (self.$h(description)) + " (PENDING: " + (self.$h(pending_message)) + ")
"); }; def.$print_summary = function(was_dry_run, duration, example_count, failure_count, pending_count) { var self = this, totals = nil, formatted_duration = nil; if (was_dry_run !== false && was_dry_run !== nil) { totals = "This was a dry-run" } else { totals = "" + (example_count) + " example" + ((function() {if (example_count['$=='](1)) { return nil } else { return "s" }; return nil; })()) + ", "; totals['$<<']("" + (failure_count) + " failure" + ((function() {if (failure_count['$=='](1)) { return nil } else { return "s" }; return nil; })())); if (pending_count['$>'](0)) { totals['$<<'](", " + (pending_count) + " pending")}; }; formatted_duration = self.$sprintf("%.5f", duration); self.output.$puts(""); self.output.$puts(""); self.output.$puts("
"); self.output.$puts(""); self.output.$puts(""); return self.output.$puts(""); }; def.$flush = function() { var self = this; return self.output.$flush(); }; def.$move_progress = function(percent_done) { var self = this; self.output.$puts(" "); return self.output.$flush(); }; def.$make_header_red = function() { var self = this; return self.output.$puts(" "); }; def.$make_header_yellow = function() { var self = this; return self.output.$puts(" "); }; def.$make_example_group_header_red = function(group_id) { var self = this; self.output.$puts(" "); return self.output.$puts(" "); }; def.$make_example_group_header_yellow = function(group_id) { var self = this; self.output.$puts(" "); return self.output.$puts(" "); }; self.$private(); def.$indentation_style = function(number_of_parents) { var self = this; return "style=\"margin-left: " + ((number_of_parents['$-'](1))['$*'](15)) + "px;\""; }; $opal.cdecl($scope, 'REPORT_HEADER', "
\n\n
\n
\n

RSpec Code Examples

\n
\n\n
\n \n \n \n
\n\n
\n

 

\n

 

\n
\n
\n\n\n
\n"); $opal.cdecl($scope, 'GLOBAL_SCRIPTS', "\nfunction addClass(element_id, classname) {\n document.getElementById(element_id).className += (\" \" + classname);\n}\n\nfunction removeClass(element_id, classname) {\n var elem = document.getElementById(element_id);\n var classlist = elem.className.replace(classname,'');\n elem.className = classlist;\n}\n\nfunction moveProgressBar(percentDone) {\n document.getElementById(\"rspec-header\").style.width = percentDone +\"%\";\n}\n\nfunction makeRed(element_id) {\n removeClass(element_id, 'passed');\n removeClass(element_id, 'not_implemented');\n addClass(element_id,'failed');\n}\n\nfunction makeYellow(element_id) {\n var elem = document.getElementById(element_id);\n if (elem.className.indexOf(\"failed\") == -1) { // class doesn't includes failed\n if (elem.className.indexOf(\"not_implemented\") == -1) { // class doesn't include not_implemented\n removeClass(element_id, 'passed');\n addClass(element_id,'not_implemented');\n }\n }\n}\n\nfunction apply_filters() {\n var passed_filter = document.getElementById('passed_checkbox').checked;\n var failed_filter = document.getElementById('failed_checkbox').checked;\n var pending_filter = document.getElementById('pending_checkbox').checked;\n\n assign_display_style(\"example passed\", passed_filter);\n assign_display_style(\"example failed\", failed_filter);\n assign_display_style(\"example not_implemented\", pending_filter);\n\n assign_display_style_for_group(\"example_group passed\", passed_filter);\n assign_display_style_for_group(\"example_group not_implemented\", pending_filter, pending_filter || passed_filter);\n assign_display_style_for_group(\"example_group failed\", failed_filter, failed_filter || pending_filter || passed_filter);\n}\n\nfunction get_display_style(display_flag) {\n var style_mode = 'none';\n if (display_flag == true) {\n style_mode = 'block';\n }\n return style_mode;\n}\n\nfunction assign_display_style(classname, display_flag) {\n var style_mode = get_display_style(display_flag);\n var elems = document.getElementsByClassName(classname)\n for (var i=0; i\n\n\n RSpec results\n \n \n \n \n \n \n\n\n"); })(self, null) })(self) })(self) })(self); }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/core/formatters/json_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, $gvars = $opal.gvars; $opal.add_stubs(['$require', '$attr_reader', '$<<', '$[]', '$[]=', '$summary_line', '$mute_profile_output?', '$dump_profile', '$pluralize', '$>', '$map', '$tap', '$exception', '$name', '$class', '$message', '$backtrace', '$format_example', '$examples', '$write', '$output', '$to_json', '$===', '$!', '$==', '$close', '$dump_profile_slowest_examples', '$dump_profile_slowest_example_groups', '$slowest_examples', '$execution_result', '$update', '$slowest_groups', '$private', '$description', '$full_description', '$metadata']); self.$require("rspec/core/formatters/base_formatter"); self.$require("json"); 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 $JsonFormatter(){}; var self = $JsonFormatter = $klass($base, $super, 'JsonFormatter', $JsonFormatter); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3; def.output_hash = nil; self.$attr_reader("output_hash"); def.$initialize = TMP_1 = function(output) {var $zuper = $slice.call(arguments, 0); var self = this, $iter = TMP_1.$$p, $yield = $iter || nil; TMP_1.$$p = null; $opal.find_super_dispatcher(self, 'initialize', TMP_1, $iter).apply(self, $zuper); return self.output_hash = $hash2([], {}); }; def.$message = function(message) { var $a, $b, $c, self = this; return (($a = "messages", $b = self.output_hash, ((($c = $b['$[]']($a)) !== false && $c !== nil) ? $c : $b['$[]=']($a, []))))['$<<'](message); }; 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]); self.output_hash['$[]=']("summary", $hash2(["duration", "example_count", "failure_count", "pending_count"], {"duration": duration, "example_count": example_count, "failure_count": failure_count, "pending_count": pending_count})); self.output_hash['$[]=']("summary_line", self.$summary_line(example_count, failure_count, pending_count)); if ((($a = self['$mute_profile_output?'](failure_count)) !== nil && (!$a.$$is_boolean || $a == true))) { return nil } else { return self.$dump_profile() }; }; 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.$stop = 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, 'stop', TMP_3, $iter).apply(self, $zuper); return self.output_hash['$[]=']("examples", ($a = ($b = self.$examples()).$map, $a.$$p = (TMP_4 = function(example){var self = TMP_4.$$s || this, $a, $b, TMP_5; if (example == null) example = nil; return ($a = ($b = self.$format_example(example)).$tap, $a.$$p = (TMP_5 = function(hash){var self = TMP_5.$$s || this, $a, e = nil; if (hash == null) hash = nil; if ((($a = e = example.$exception()) !== nil && (!$a.$$is_boolean || $a == true))) { return hash['$[]=']("exception", $hash2(["class", "message", "backtrace"], {"class": e.$class().$name(), "message": e.$message(), "backtrace": e.$backtrace()})) } else { return nil }}, TMP_5.$$s = self, TMP_5), $a).call($b)}, TMP_4.$$s = self, TMP_4), $a).call($b)); }; def.$close = function() { var $a, $b, self = this; if ($gvars.stdout == null) $gvars.stdout = nil; self.$output().$write(self.output_hash.$to_json()); 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 }; }; def.$dump_profile = function() { var self = this; self.output_hash['$[]=']("profile", $hash2([], {})); self.$dump_profile_slowest_examples(); return self.$dump_profile_slowest_example_groups(); }; def.$dump_profile_slowest_examples = function() { var $a, $b, TMP_6, self = this, sorted_examples = nil; self.output_hash['$[]=']("profile", $hash2([], {})); sorted_examples = self.$slowest_examples(); self.output_hash['$[]']("profile")['$[]=']("examples", ($a = ($b = sorted_examples['$[]']("examples")).$map, $a.$$p = (TMP_6 = function(example){var self = TMP_6.$$s || this, $a, $b, TMP_7; if (example == null) example = nil; return ($a = ($b = self.$format_example(example)).$tap, $a.$$p = (TMP_7 = function(hash){var self = TMP_7.$$s || this; if (hash == null) hash = nil; return hash['$[]=']("run_time", example.$execution_result()['$[]']("run_time"))}, TMP_7.$$s = self, TMP_7), $a).call($b)}, TMP_6.$$s = self, TMP_6), $a).call($b)); self.output_hash['$[]']("profile")['$[]=']("slowest", sorted_examples['$[]']("slows")); return self.output_hash['$[]']("profile")['$[]=']("total", sorted_examples['$[]']("total")); }; def.$dump_profile_slowest_example_groups = function() { var $a, $b, $c, TMP_8, self = this; ($a = "profile", $b = self.output_hash, ((($c = $b['$[]']($a)) !== false && $c !== nil) ? $c : $b['$[]=']($a, $hash2([], {})))); return self.output_hash['$[]']("profile")['$[]=']("groups", ($a = ($b = self.$slowest_groups()).$map, $a.$$p = (TMP_8 = function(loc, hash){var self = TMP_8.$$s || this; if (loc == null) loc = nil;if (hash == null) hash = nil; return hash.$update($hash2(["location"], {"location": loc}))}, TMP_8.$$s = self, TMP_8), $a).call($b)); }; self.$private(); return (def.$format_example = function(example) { var self = this; return $hash2(["description", "full_description", "status", "file_path", "line_number"], {"description": example.$description(), "full_description": example.$full_description(), "status": example.$execution_result()['$[]']("status"), "file_path": example.$metadata()['$[]']("file_path"), "line_number": example.$metadata()['$[]']("line_number")}); }, nil) && 'format_example'; })(self, $scope.get('BaseFormatter')) })(self) })(self) })(self); }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/core/formatters/progress_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', '$print', '$output', '$success_color', '$pending_color', '$failure_color', '$puts']); 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 $ProgressFormatter(){}; var self = $ProgressFormatter = $klass($base, $super, 'ProgressFormatter', $ProgressFormatter); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4; def.$example_passed = TMP_1 = function(example) { var self = this, $iter = TMP_1.$$p, $yield = $iter || nil; TMP_1.$$p = null; $opal.find_super_dispatcher(self, 'example_passed', TMP_1, null).apply(self, [example]); return self.$output().$print(self.$success_color(".")); }; def.$example_pending = TMP_2 = function(example) { var self = this, $iter = TMP_2.$$p, $yield = $iter || nil; TMP_2.$$p = null; $opal.find_super_dispatcher(self, 'example_pending', TMP_2, null).apply(self, [example]); return self.$output().$print(self.$pending_color("*")); }; def.$example_failed = TMP_3 = function(example) { var self = this, $iter = TMP_3.$$p, $yield = $iter || nil; TMP_3.$$p = null; $opal.find_super_dispatcher(self, 'example_failed', TMP_3, null).apply(self, [example]); return self.$output().$print(self.$failure_color("F")); }; return (def.$start_dump = TMP_4 = function() { var self = this, $iter = TMP_4.$$p, $yield = $iter || nil; TMP_4.$$p = null; $opal.find_super_dispatcher(self, 'start_dump', TMP_4, null).apply(self, []); return self.$output().$puts(); }, nil) && 'start_dump'; })(self, $scope.get('BaseTextFormatter')) })(self) })(self) })(self); }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/core/formatters/snippet_extractor"] = 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, $range = $opal.range; $opal.add_stubs(['$html', '$scan', '$require', '$new', '$snippet_for', '$[]', '$convert', '$post_process', '$=~', '$to_i', '$lines_around', '$file?', '$split', '$read', '$max', '$-', '$min', '$+', '$length', '$join', '$each_with_index', '$==', '$<<']); 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 $SnippetExtractor(){}; var self = $SnippetExtractor = $klass($base, $super, 'SnippetExtractor', $SnippetExtractor); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $NullConverter(){}; var self = $NullConverter = $klass($base, $super, 'NullConverter', $NullConverter); var def = self.$$proto, $scope = self.$$scope; return (def.$convert = function(code) { var self = this; return "" + (code) + "\n# Install the coderay gem to get syntax highlighting"; }, nil) && 'convert' })(self, null); (function($base, $super) { function $CoderayConverter(){}; var self = $CoderayConverter = $klass($base, $super, 'CoderayConverter', $CoderayConverter); var def = self.$$proto, $scope = self.$$scope; return (def.$convert = function(code) { var self = this; return $scope.get('CodeRay').$scan(code, "ruby").$html($hash2(["line_numbers"], {"line_numbers": false})); }, nil) && 'convert' })(self, null); try { self.$require("coderay"); ($opal.cvars['@@converter'] = $scope.get('CoderayConverter').$new()); } catch ($err) {if ($opal.$rescue($err, [$scope.get('LoadError')])) { ($opal.cvars['@@converter'] = $scope.get('NullConverter').$new()) }else { throw $err; } }; def.$snippet = function(backtrace) { var $a, self = this, raw_code = nil, line = nil, highlighted = nil; $a = $opal.to_ary(self.$snippet_for(backtrace['$[]'](0))), raw_code = ($a[0] == null ? nil : $a[0]), line = ($a[1] == null ? nil : $a[1]); highlighted = (($a = $opal.cvars['@@converter']) == null ? nil : $a).$convert(raw_code); return self.$post_process(highlighted, line); }; def.$snippet_for = function(error_line) { var $a, self = this, file = nil, line = nil; if ((($a = error_line['$=~'](/(.*):(\d+)/)) !== nil && (!$a.$$is_boolean || $a == true))) { file = nil; line = nil.$to_i(); return [self.$lines_around(file, line), line]; } else { return ["# Couldn't get snippet for " + (error_line), 1] }; }; def.$lines_around = function(file, line) { var $a, self = this, lines = nil, min = nil, max = nil, selected_lines = nil; try { if ((($a = $scope.get('File')['$file?'](file)) !== nil && (!$a.$$is_boolean || $a == true))) { lines = $scope.get('File').$read(file).$split("\n"); min = [0, line['$-'](3)].$max(); max = [line['$+'](1), lines.$length()['$-'](1)].$min(); selected_lines = []; selected_lines.$join("\n"); return lines['$[]']($range(min, max, false)).$join("\n"); } else { return "# Couldn't get snippet for " + (file) } } catch ($err) {if ($opal.$rescue($err, [$scope.get('SecurityError')])) { return "# Couldn't get snippet for " + (file) }else { throw $err; } }; }; return (def.$post_process = function(highlighted, offending_line) { var $a, $b, TMP_1, self = this, new_lines = nil; new_lines = []; ($a = ($b = highlighted.$split("\n")).$each_with_index, $a.$$p = (TMP_1 = function(line, i){var self = TMP_1.$$s || this, new_line = nil; if (line == null) line = nil;if (i == null) i = nil; new_line = "" + (offending_line['$+'](i)['$-'](2)) + "" + (line); if (i['$=='](2)) { new_line = "" + (new_line) + ""}; return new_lines['$<<'](new_line);}, TMP_1.$$s = self, TMP_1), $a).call($b); return new_lines.$join("\n"); }, nil) && 'post_process'; })(self, null) })(self) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/core/formatters"] = 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, 'Formatters'); var def = self.$$proto, $scope = self.$$scope; nil })((($scope.get('RSpec')).$$scope.get('Core'))) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/core/hooks"] = 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(['$attr_reader', '$all_apply?', '$options', '$instance_exec', '$to_proc', '$block', '$instance_exec_with_rescue', '$message', '$reporter', '$configuration', '$class', '$first', '$backtrace', '$each', '$define_method', '$__send__', '$hooks', '$public_instance_methods', '$protected', '$with', '$new', '$select', '$options_apply?', '$run', '$call', '$reduce', '$wrap', '$empty?', '$shift', '$[]', '$process', '$private', '$==', '$any?', '$include?', '$parent_groups', '$<<', '$register_hook', '$alias_method', '$dry_run?', '$find_hook', '$for', '$flat_map', '$[]=', '$reverse', '$scope_and_options_from', '$send', '$===', '$before_all_hooks_for', '$after_all_hooks_for', '$around_each_hooks_for', '$before_each_hooks_for', '$after_each_hooks_for', '$extract_scope_from', '$build_hash_from', '$is_a?', '$raise']); 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, 'Hooks'); var def = self.$$proto, $scope = self.$$scope, TMP_10, TMP_11, TMP_12, TMP_13, TMP_14, $a, $b, TMP_16, $c, TMP_17, $d, TMP_18, TMP_21; (function($base, $super) { function $Hook(){}; var self = $Hook = $klass($base, $super, 'Hook', $Hook); var def = self.$$proto, $scope = self.$$scope; self.$attr_reader("block", "options"); def.$initialize = function(block, options) { var self = this; self.block = block; return self.options = options; }; return (def['$options_apply?'] = function(example_or_group) { var self = this; return example_or_group['$all_apply?'](self.$options()); }, nil) && 'options_apply?'; })(self, null); (function($base, $super) { function $BeforeHook(){}; var self = $BeforeHook = $klass($base, $super, 'BeforeHook', $BeforeHook); var def = self.$$proto, $scope = self.$$scope; def.$run = function(example) { var $a, $b, self = this; return ($a = ($b = example).$instance_exec, $a.$$p = self.$block().$to_proc(), $a).call($b, example); }; return (def.$display_name = function() { var self = this; return "before hook"; }, nil) && 'display_name'; })(self, $scope.get('Hook')); (function($base, $super) { function $AfterHook(){}; var self = $AfterHook = $klass($base, $super, 'AfterHook', $AfterHook); var def = self.$$proto, $scope = self.$$scope; def.$run = function(example) { var $a, $b, self = this; return ($a = ($b = example).$instance_exec_with_rescue, $a.$$p = self.$block().$to_proc(), $a).call($b, "in an after hook"); }; return (def.$display_name = function() { var self = this; return "after hook"; }, nil) && 'display_name'; })(self, $scope.get('Hook')); (function($base, $super) { function $AfterAllHook(){}; var self = $AfterAllHook = $klass($base, $super, 'AfterAllHook', $AfterAllHook); var def = self.$$proto, $scope = self.$$scope; def.$run = function(example) { var $a, $b, self = this, e = nil; try { return ($a = ($b = example).$instance_exec, $a.$$p = self.$block().$to_proc(), $a).call($b, example) } catch ($err) {if ($opal.$rescue($err, [$scope.get('Exception')])) {e = $err; return $scope.get('RSpec').$configuration().$reporter().$message("\nAn error occurred in an after(:all) hook.\n " + (e.$class()) + ": " + (e.$message()) + "\n occurred at " + (e.$backtrace().$first()) + "\n\n") }else { throw $err; } }; }; return (def.$display_name = function() { var self = this; return "after(:all) hook"; }, nil) && 'display_name'; })(self, $scope.get('Hook')); (function($base, $super) { function $AroundHook(){}; var self = $AroundHook = $klass($base, $super, 'AroundHook', $AroundHook); var def = self.$$proto, $scope = self.$$scope; return (def.$display_name = function() { var self = this; return "around hook"; }, nil) && 'display_name' })(self, $scope.get('Hook')); (function($base, $super) { function $BaseHookCollection(){}; var self = $BaseHookCollection = $klass($base, $super, 'BaseHookCollection', $BaseHookCollection); var def = self.$$proto, $scope = self.$$scope, $a, $b, TMP_1; ($a = ($b = $scope.get('Array').$public_instance_methods(false)).$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(a){var self = TMP_2.$$s || this, b, $a, $b; a = $slice.call(arguments, 0); b = TMP_2.$$p || nil, TMP_2.$$p = null; return ($a = ($b = self.$hooks()).$__send__, $a.$$p = b.$to_proc(), $a).apply($b, [name].concat(a))}, TMP_2.$$s = self, TMP_2), $a).call($b, name)}, TMP_1.$$s = self, TMP_1), $a).call($b); self.$attr_reader("hooks"); self.$protected("hooks"); $opal.defn(self, '$append', def.$push); $opal.defn(self, '$prepend', def.$unshift); return (def.$initialize = function(hooks) { var self = this; if (hooks == null) { hooks = [] } return self.hooks = hooks; }, nil) && 'initialize'; })(self, null); (function($base, $super) { function $HookCollection(){}; var self = $HookCollection = $klass($base, $super, 'HookCollection', $HookCollection); var def = self.$$proto, $scope = self.$$scope; def.$for = function(example_or_group) { var $a, $b, TMP_3, self = this; return self.$class().$new(($a = ($b = self.$hooks()).$select, $a.$$p = (TMP_3 = function(hook){var self = TMP_3.$$s || this; if (hook == null) hook = nil; return hook['$options_apply?'](example_or_group)}, TMP_3.$$s = self, TMP_3), $a).call($b)).$with(example_or_group); }; def.$with = function(example) { var self = this; self.example = example; return self; }; return (def.$run = function() { var $a, $b, TMP_4, self = this; return ($a = ($b = self.$hooks()).$each, $a.$$p = (TMP_4 = function(h){var self = TMP_4.$$s || this; if (self.example == null) self.example = nil; if (h == null) h = nil; return h.$run(self.example)}, TMP_4.$$s = self, TMP_4), $a).call($b); }, nil) && 'run'; })(self, $scope.get('BaseHookCollection')); (function($base, $super) { function $AroundHookCollection(){}; var self = $AroundHookCollection = $klass($base, $super, 'AroundHookCollection', $AroundHookCollection); var def = self.$$proto, $scope = self.$$scope; def.initial_procsy = nil; def.$for = function(example, initial_procsy) { var $a, $b, TMP_5, self = this; if (initial_procsy == null) { initial_procsy = nil } return self.$class().$new(($a = ($b = self.$hooks()).$select, $a.$$p = (TMP_5 = function(hook){var self = TMP_5.$$s || this; if (hook == null) hook = nil; return hook['$options_apply?'](example)}, TMP_5.$$s = self, TMP_5), $a).call($b)).$with(example, initial_procsy); }; def.$with = function(example, initial_procsy) { var self = this; self.example = example; self.initial_procsy = initial_procsy; return self; }; return (def.$run = function() { var $a, $b, TMP_6, self = this; return ($a = ($b = self.$hooks()).$reduce, $a.$$p = (TMP_6 = function(procsy, around_hook){var self = TMP_6.$$s || this, $a, $b, TMP_7; if (procsy == null) procsy = nil;if (around_hook == null) around_hook = nil; return ($a = ($b = procsy).$wrap, $a.$$p = (TMP_7 = function(){var self = TMP_7.$$s || this, $a, $b; if (self.example == null) self.example = nil; return ($a = ($b = self.example).$instance_exec, $a.$$p = around_hook.$block().$to_proc(), $a).call($b, procsy)}, TMP_7.$$s = self, TMP_7), $a).call($b)}, TMP_6.$$s = self, TMP_6), $a).call($b, self.initial_procsy).$call(); }, nil) && 'run'; })(self, $scope.get('BaseHookCollection')); (function($base, $super) { function $GroupHookCollection(){}; var self = $GroupHookCollection = $klass($base, $super, 'GroupHookCollection', $GroupHookCollection); var def = self.$$proto, $scope = self.$$scope; def.group = nil; def.$for = function(group) { var self = this; self.group = group; return self; }; return (def.$run = function() { var $a, $b, self = this; return (function() {while (!((($b = self.$hooks()['$empty?']()) !== nil && (!$b.$$is_boolean || $b == true)))) { self.$hooks().$shift().$run(self.group)}; return nil; })(); }, nil) && 'run'; })(self, $scope.get('BaseHookCollection')); (function($base, $super) { function $HookCollections(){}; var self = $HookCollections = $klass($base, $super, 'HookCollections', $HookCollections); var def = self.$$proto, $scope = self.$$scope; def.data = nil; def.$initialize = function(data) { var self = this; return self.data = data; }; def['$[]'] = function(key) { var self = this; return self.data['$[]'](key); }; def.$register_globals = function(host, globals) { var self = this; self.$process(host, globals, "before", "each"); self.$process(host, globals, "after", "each"); self.$process(host, globals, "around", "each"); self.$process(host, globals, "before", "all"); return self.$process(host, globals, "after", "all"); }; self.$private(); return (def.$process = function(host, globals, position, scope) { var $a, $b, TMP_8, self = this; return ($a = ($b = globals['$[]'](position)['$[]'](scope)).$each, $a.$$p = (TMP_8 = function(hook){var self = TMP_8.$$s || this, $a, $b, $c, TMP_9; if (hook == null) hook = nil; if ((($a = ((($b = scope['$==']("each")) !== false && $b !== nil) ? $b : hook['$options_apply?'](host))) !== nil && (!$a.$$is_boolean || $a == true))) { } else { return nil; }; if ((($a = ($b = ($c = host.$parent_groups())['$any?'], $b.$$p = (TMP_9 = function(a){var self = TMP_9.$$s || this; if (a == null) a = nil; return a.$hooks()['$[]'](position)['$[]'](scope)['$include?'](hook)}, TMP_9.$$s = self, TMP_9), $b).call($c)) !== nil && (!$a.$$is_boolean || $a == true))) { return nil;}; return self['$[]'](position)['$[]'](scope)['$<<'](hook);}, TMP_8.$$s = self, TMP_8), $a).call($b); }, nil) && 'process'; })(self, null); def.$hooks = function() { var $a, self = this; if (self.hooks == null) self.hooks = nil; return ((($a = self.hooks) !== false && $a !== nil) ? $a : self.hooks = $scope.get('HookCollections').$new($hash2(["around", "before", "after"], {"around": $hash2(["each"], {"each": $scope.get('AroundHookCollection').$new()}), "before": $hash2(["each", "all", "suite"], {"each": $scope.get('HookCollection').$new(), "all": $scope.get('HookCollection').$new(), "suite": $scope.get('HookCollection').$new()}), "after": $hash2(["each", "all", "suite"], {"each": $scope.get('HookCollection').$new(), "all": $scope.get('HookCollection').$new(), "suite": $scope.get('HookCollection').$new()})}))); }; def.$before = 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).$register_hook, $a.$$p = block.$to_proc(), $a).apply($b, ["append", "before"].concat(args)); }; self.$alias_method("append_before", "before"); def.$prepend_before = TMP_11 = function(args) { var $a, $b, self = this, $iter = TMP_11.$$p, block = $iter || nil; args = $slice.call(arguments, 0); TMP_11.$$p = null; return ($a = ($b = self).$register_hook, $a.$$p = block.$to_proc(), $a).apply($b, ["prepend", "before"].concat(args)); }; def.$after = TMP_12 = function(args) { var $a, $b, self = this, $iter = TMP_12.$$p, block = $iter || nil; args = $slice.call(arguments, 0); TMP_12.$$p = null; return ($a = ($b = self).$register_hook, $a.$$p = block.$to_proc(), $a).apply($b, ["prepend", "after"].concat(args)); }; self.$alias_method("prepend_after", "after"); def.$append_after = TMP_13 = function(args) { var $a, $b, self = this, $iter = TMP_13.$$p, block = $iter || nil; args = $slice.call(arguments, 0); TMP_13.$$p = null; return ($a = ($b = self).$register_hook, $a.$$p = block.$to_proc(), $a).apply($b, ["append", "after"].concat(args)); }; def.$around = TMP_14 = function(args) { var $a, $b, self = this, $iter = TMP_14.$$p, block = $iter || nil; args = $slice.call(arguments, 0); TMP_14.$$p = null; return ($a = ($b = self).$register_hook, $a.$$p = block.$to_proc(), $a).apply($b, ["prepend", "around"].concat(args)); }; def.$run_hook = function(hook, scope, example_or_group, initial_procsy) { var $a, self = this; if (example_or_group == null) { example_or_group = $scope.get('ExampleGroup').$new() } if (initial_procsy == null) { initial_procsy = nil } if ((($a = $scope.get('RSpec').$configuration()['$dry_run?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return nil}; return self.$find_hook(hook, scope, example_or_group, initial_procsy).$run(); }; def.$around_each_hooks_for = function(example, initial_procsy) { var $a, $b, TMP_15, self = this; if (initial_procsy == null) { initial_procsy = nil } return $scope.get('AroundHookCollection').$new(($a = ($b = $scope.get('FlatMap')).$flat_map, $a.$$p = (TMP_15 = function(a){var self = TMP_15.$$s || this; if (a == null) a = nil; return a.$hooks()['$[]']("around")['$[]']("each")}, TMP_15.$$s = self, TMP_15), $a).call($b, self.$parent_groups())).$for(example, initial_procsy); }; self.$private(); $opal.cdecl($scope, 'SCOPES', ["each", "all", "suite"]); $opal.cdecl($scope, 'HOOK_TYPES', $hash2(["before", "after", "around"], {"before": ($a = ($b = $scope.get('Hash')).$new, $a.$$p = (TMP_16 = function(){var self = TMP_16.$$s || this; return $scope.get('BeforeHook')}, TMP_16.$$s = self, TMP_16), $a).call($b), "after": ($a = ($c = $scope.get('Hash')).$new, $a.$$p = (TMP_17 = function(){var self = TMP_17.$$s || this; return $scope.get('AfterHook')}, TMP_17.$$s = self, TMP_17), $a).call($c), "around": ($a = ($d = $scope.get('Hash')).$new, $a.$$p = (TMP_18 = function(){var self = TMP_18.$$s || this; return $scope.get('AroundHook')}, TMP_18.$$s = self, TMP_18), $a).call($d)})); $scope.get('HOOK_TYPES')['$[]']("after")['$[]=']("all", $scope.get('AfterAllHook')); def.$before_all_hooks_for = function(group) { var self = this; return $scope.get('GroupHookCollection').$new(self.$hooks()['$[]']("before")['$[]']("all")).$for(group); }; def.$after_all_hooks_for = function(group) { var self = this; return $scope.get('GroupHookCollection').$new(self.$hooks()['$[]']("after")['$[]']("all")).$for(group); }; def.$before_each_hooks_for = function(example) { var $a, $b, TMP_19, self = this; return $scope.get('HookCollection').$new(($a = ($b = $scope.get('FlatMap')).$flat_map, $a.$$p = (TMP_19 = function(a){var self = TMP_19.$$s || this; if (a == null) a = nil; return a.$hooks()['$[]']("before")['$[]']("each")}, TMP_19.$$s = self, TMP_19), $a).call($b, self.$parent_groups().$reverse())).$for(example); }; def.$after_each_hooks_for = function(example) { var $a, $b, TMP_20, self = this; return $scope.get('HookCollection').$new(($a = ($b = $scope.get('FlatMap')).$flat_map, $a.$$p = (TMP_20 = function(a){var self = TMP_20.$$s || this; if (a == null) a = nil; return a.$hooks()['$[]']("after")['$[]']("each")}, TMP_20.$$s = self, TMP_20), $a).call($b, self.$parent_groups())).$for(example); }; def.$register_hook = TMP_21 = function(prepend_or_append, hook, args) { var $a, $b, self = this, $iter = TMP_21.$$p, block = $iter || nil, scope = nil, options = nil; args = $slice.call(arguments, 2); TMP_21.$$p = null; $a = $opal.to_ary(($b = self).$scope_and_options_from.apply($b, [].concat(args))), scope = ($a[0] == null ? nil : $a[0]), options = ($a[1] == null ? nil : $a[1]); return self.$hooks()['$[]'](hook)['$[]'](scope).$send(prepend_or_append, $scope.get('HOOK_TYPES')['$[]'](hook)['$[]'](scope).$new(block, options)); }; def.$find_hook = function(hook, scope, example_or_group, initial_procsy) { var self = this, $case = nil; return (function() {$case = [hook, scope];if (["before", "all"]['$===']($case)) {return self.$before_all_hooks_for(example_or_group)}else if (["after", "all"]['$===']($case)) {return self.$after_all_hooks_for(example_or_group)}else if (["around", "each"]['$===']($case)) {return self.$around_each_hooks_for(example_or_group, initial_procsy)}else if (["before", "each"]['$===']($case)) {return self.$before_each_hooks_for(example_or_group)}else if (["after", "each"]['$===']($case)) {return self.$after_each_hooks_for(example_or_group)}else if (["before", "suite"]['$===']($case) || ["after", "suite"]['$===']($case)) {return self.$hooks()['$[]'](hook)['$[]']("suite").$with(example_or_group)}else { return nil }})(); }; def.$scope_and_options_from = function(args) { var self = this; args = $slice.call(arguments, 0); return [self.$extract_scope_from(args), $scope.get('Metadata').$build_hash_from(args)]; }; def.$extract_scope_from = function(args) { var $a, $b, $c, TMP_22, self = this; if ((($a = $scope.get('SCOPES')['$include?'](args.$first())) !== nil && (!$a.$$is_boolean || $a == true))) { return args.$shift() } else if ((($a = ($b = ($c = args)['$any?'], $b.$$p = (TMP_22 = function(a){var self = TMP_22.$$s || this; if (a == null) a = nil; return a['$is_a?']($scope.get('Symbol'))}, TMP_22.$$s = self, TMP_22), $b).call($c)) !== nil && (!$a.$$is_boolean || $a == true))) { return self.$raise($scope.get('ArgumentError').$new("You must explicitly give a scope (:each, :all, or :suite) when using symbols as metadata for a hook.")) } else { return "each" }; }; ;$opal.donate(self, ["$hooks", "$before", "$prepend_before", "$after", "$append_after", "$around", "$run_hook", "$around_each_hooks_for", "$before_all_hooks_for", "$after_all_hooks_for", "$before_each_hooks_for", "$after_each_hooks_for", "$register_hook", "$find_hook", "$scope_and_options_from", "$extract_scope_from"]); })(self) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/core/memoized_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, $hash2 = $opal.hash2, $klass = $opal.klass; $opal.add_stubs(['$fetch', '$[]=', '$__memoized', '$described_class', '$description', '$class', '$===', '$new', '$handle_matcher', '$subject', '$private', '$instance_eval', '$==', '$raise', '$article', '$hook_expression', '$first_non_rspec_line', '$hook_intention', '$extend', '$nil?', '$send', '$to_proc', '$module_for', '$arity', '$define_method', '$current_example', '$let', '$before', '$__send__', '$alias_method', '$get_constant_or_yield', '$include', '$const_set', '$method', '$const_defined?', '$const_get']); 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, 'MemoizedHelpers'); var def = self.$$proto, $scope = self.$$scope, TMP_19, TMP_20; def.$subject = function() { var $a, $b, TMP_1, self = this; return ($a = ($b = self.$__memoized()).$fetch, $a.$$p = (TMP_1 = function(){var self = TMP_1.$$s || this, $a, described = nil; return self.$__memoized()['$[]=']("subject", (function() {described = ((($a = self.$described_class()) !== false && $a !== nil) ? $a : self.$class().$description()); if ((($a = $scope.get('Class')['$==='](described)) !== nil && (!$a.$$is_boolean || $a == true))) { return described.$new() } else { return described };})())}, TMP_1.$$s = self, TMP_1), $a).call($b, "subject"); }; def.$should = function(matcher, message) { var self = this; if (matcher == null) { matcher = nil } if (message == null) { message = nil } return (((($scope.get('RSpec')).$$scope.get('Expectations'))).$$scope.get('PositiveExpectationHandler')).$handle_matcher(self.$subject(), matcher, message); }; def.$should_not = function(matcher, message) { var self = this; if (matcher == null) { matcher = nil } if (message == null) { message = nil } return (((($scope.get('RSpec')).$$scope.get('Expectations'))).$$scope.get('NegativeExpectationHandler')).$handle_matcher(self.$subject(), matcher, message); }; self.$private(); def.$__memoized = function() { var $a, self = this; if (self.__memoized == null) self.__memoized = nil; return ((($a = self.__memoized) !== false && $a !== nil) ? $a : self.__memoized = $hash2([], {})); }; (function($base, $super) { function $AllHookMemoizedHash(){}; var self = $AllHookMemoizedHash = $klass($base, $super, 'AllHookMemoizedHash', $AllHookMemoizedHash); var def = self.$$proto, $scope = self.$$scope, TMP_3, TMP_4; $opal.defs(self, '$isolate_for_all_hook', TMP_3 = function(example_group_instance) { var $a, $b, TMP_2, self = this, $iter = TMP_3.$$p, $yield = $iter || nil, hash = nil; TMP_3.$$p = null; hash = self; return ($a = ($b = example_group_instance).$instance_eval, $a.$$p = (TMP_2 = function(){var self = TMP_2.$$s || this, $a; self.__memoized = hash; try { return $a = $opal.$yieldX($yield, []), $a === $breaker ? $a : $a } finally { self.__memoized = nil };}, TMP_2.$$s = self, TMP_2), $a).call($b); }); $opal.defs(self, '$fetch', TMP_4 = function(key) { var self = this, $iter = TMP_4.$$p, block = $iter || nil, description = nil; TMP_4.$$p = null; description = (function() {if (key['$==']("subject")) { return "subject" } else { return "let declaration `" + (key) + "`" }; return nil; })(); return self.$raise("" + (description) + " accessed in " + (self.$article()) + " " + (self.$hook_expression()) + " hook at:\n " + ($scope.get('CallerFilter').$first_non_rspec_line()) + "\n\n`let` and `subject` declarations are not intended to be called\nin " + (self.$article()) + " " + (self.$hook_expression()) + " hook, as they exist to define state that\nis reset between each example, while " + (self.$hook_expression()) + " exists to\n" + (self.$hook_intention()) + ".\n"); }); (function($base, $super) { function $Before(){}; var self = $Before = $klass($base, $super, 'Before', $Before); var def = self.$$proto, $scope = self.$$scope; $opal.defs(self, '$hook_expression', function() { var self = this; return "`before(:all)`"; }); $opal.defs(self, '$article', function() { var self = this; return "a"; }); return ($opal.defs(self, '$hook_intention', function() { var self = this; return "define state that is shared across examples in an example group"; }), nil) && 'hook_intention'; })(self, self); return (function($base, $super) { function $After(){}; var self = $After = $klass($base, $super, 'After', $After); var def = self.$$proto, $scope = self.$$scope; $opal.defs(self, '$hook_expression', function() { var self = this; return "`after(:all)`"; }); $opal.defs(self, '$article', function() { var self = this; return "an"; }); return ($opal.defs(self, '$hook_intention', function() { var self = this; return "cleanup state that is shared across examples in an example group"; }), nil) && 'hook_intention'; })(self, self); })(self, null); $opal.defs(self, '$included', function(mod) { var self = this; return mod.$extend($scope.get('ClassMethods')); }); (function($base) { var self = $module($base, 'ClassMethods'); var def = self.$$proto, $scope = self.$$scope, TMP_5, TMP_10, TMP_12, TMP_14; def.$let = TMP_5 = function(name) { var $a, $b, $c, TMP_6, $d, TMP_8, self = this, $iter = TMP_5.$$p, block = $iter || nil; TMP_5.$$p = null; if ((($a = block['$nil?']()) !== nil && (!$a.$$is_boolean || $a == true))) { self.$raise("#let or #subject called without a block")}; ($a = ($b = $scope.get('MemoizedHelpers').$module_for(self)).$send, $a.$$p = block.$to_proc(), $a).call($b, "define_method", name); if (block.$arity()['$=='](1)) { return ($a = ($c = self).$define_method, $a.$$p = (TMP_6 = function(){var self = TMP_6.$$s || this, $a, $b, TMP_7; return ($a = ($b = self.$__memoized()).$fetch, $a.$$p = (TMP_7 = function(k){var self = TMP_7.$$s || this; if (k == null) k = nil; return self.$__memoized()['$[]='](k, $opal.find_iter_super_dispatcher(self, 'let', (TMP_7.$$def || TMP_6.$$def || TMP_5), null).apply(self, [$scope.get('RSpec').$current_example(), nil.$to_proc()]))}, TMP_7.$$s = self, TMP_7), $a).call($b, name)}, TMP_6.$$s = self, TMP_6), $a).call($c, name) } else { return ($a = ($d = self).$define_method, $a.$$p = (TMP_8 = function(){var self = TMP_8.$$s || this, $a, $b, TMP_9; return ($a = ($b = self.$__memoized()).$fetch, $a.$$p = (TMP_9 = function(k){var self = TMP_9.$$s || this; if (k == null) k = nil; return self.$__memoized()['$[]='](k, $opal.find_iter_super_dispatcher(self, 'let', (TMP_9.$$def || TMP_8.$$def || TMP_5), null).apply(self, [nil.$to_proc()]))}, TMP_9.$$s = self, TMP_9), $a).call($b, name)}, TMP_8.$$s = self, TMP_8), $a).call($d, name) }; }; def['$let!'] = TMP_10 = function(name) { var $a, $b, $c, TMP_11, self = this, $iter = TMP_10.$$p, block = $iter || nil; TMP_10.$$p = null; ($a = ($b = self).$let, $a.$$p = block.$to_proc(), $a).call($b, name); return ($a = ($c = self).$before, $a.$$p = (TMP_11 = function(){var self = TMP_11.$$s || this; return self.$__send__(name)}, TMP_11.$$s = self, TMP_11), $a).call($c); }; def.$subject = TMP_12 = function(name) { var $a, $b, $c, TMP_13, $d, self = this, $iter = TMP_12.$$p, block = $iter || nil; if (name == null) { name = nil } TMP_12.$$p = null; if (name !== false && name !== nil) { ($a = ($b = self).$let, $a.$$p = block.$to_proc(), $a).call($b, name); self.$alias_method("subject", name); return ($a = ($c = ((self).$$scope.get('NamedSubjectPreventSuper'))).$send, $a.$$p = (TMP_13 = function(){var self = TMP_13.$$s || this; return self.$raise($scope.get('NotImplementedError'), "`super` in named subjects is not supported")}, TMP_13.$$s = self, TMP_13), $a).call($c, "define_method", name); } else { return ($a = ($d = self).$let, $a.$$p = block.$to_proc(), $a).call($d, "subject") }; }; def['$subject!'] = TMP_14 = function(name) { var $a, $b, $c, TMP_15, self = this, $iter = TMP_14.$$p, block = $iter || nil; if (name == null) { name = nil } TMP_14.$$p = null; ($a = ($b = self).$subject, $a.$$p = block.$to_proc(), $a).call($b, name); return ($a = ($c = self).$before, $a.$$p = (TMP_15 = function(){var self = TMP_15.$$s || this; return self.$subject()}, TMP_15.$$s = self, TMP_15), $a).call($c); }; ;$opal.donate(self, ["$let", "$let!", "$subject", "$subject!"]); })(self); $opal.defs(self, '$module_for', function(example_group) { var $a, $b, TMP_16, self = this; return ($a = ($b = self).$get_constant_or_yield, $a.$$p = (TMP_16 = function(){var self = TMP_16.$$s || this, $a, $b, TMP_17, mod = nil; mod = ($a = ($b = $scope.get('Module')).$new, $a.$$p = (TMP_17 = function(){var self = TMP_17.$$s || this, $a, $b, TMP_18; return self.$include(($a = ($b = $scope.get('Module')).$new, $a.$$p = (TMP_18 = function(){var self = TMP_18.$$s || this; return example_group.$const_set("NamedSubjectPreventSuper", self)}, TMP_18.$$s = self, TMP_18), $a).call($b))}, TMP_17.$$s = self, TMP_17), $a).call($b); example_group.$const_set("LetDefinitions", mod); return mod;}, TMP_16.$$s = self, TMP_16), $a).call($b, example_group, "LetDefinitions"); }); $opal.defs(self, '$define_helpers_on', function(example_group) { var self = this; return example_group.$send("include", self.$module_for(example_group)); }); if ($scope.get('Module').$method("const_defined?").$arity()['$=='](1)) { $opal.defs(self, '$get_constant_or_yield', TMP_19 = function(example_group, name) { var $a, self = this, $iter = TMP_19.$$p, $yield = $iter || nil; TMP_19.$$p = null; if ((($a = example_group['$const_defined?'](name)) !== nil && (!$a.$$is_boolean || $a == true))) { return example_group.$const_get(name) } else { return $a = $opal.$yieldX($yield, []), $a === $breaker ? $a : $a }; }) } else { $opal.defs(self, '$get_constant_or_yield', TMP_20 = function(example_group, name) { var $a, self = this, $iter = TMP_20.$$p, $yield = $iter || nil, check_ancestors = nil; TMP_20.$$p = null; if ((($a = example_group['$const_defined?'](name, (check_ancestors = false))) !== nil && (!$a.$$is_boolean || $a == true))) { return example_group.$const_get(name, check_ancestors) } else { return $a = $opal.$yieldX($yield, []), $a === $breaker ? $a : $a }; }) }; ;$opal.donate(self, ["$subject", "$should", "$should_not", "$__memoized"]); })(self) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/core/metadata"] = 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, $hash = $opal.hash; $opal.add_stubs(['$sub', '$expand_path', '$==', '$is_a?', '$last', '$pop', '$[]=', '$has_key?', '$store_computed', '$private', '$===', '$store', '$location', '$file_and_line_number', '$described_class', '$full_description', '$build_description_from', '$[]', '$=~', '$first_caller_from_outside_rspec', '$relative_path', '$to_i', '$detect', '$inject', '$to_s', '$method_description_after_module?', '$+', '$include', '$each', '$nil?', '$container_stack', '$first', '$reverse', '$flat_map', '$<<', '$update', '$extend', '$ensure_valid_keys', '$delete', '$caller', '$configure_for_example', '$dup', '$any?', '$filter_applies?', '$all?', '$!', '$filter_applies_to_any_value?', '$line_number_filter_applies?', '$location_filter_applies?', '$filters_apply?', '$arity', '$call', '$example_group_declaration_line', '$map', '$preceding_declaration_line', '$world', '$empty?', '$&', '$relevant_line_numbers', '$protected', '$raise', '$*', '$first_non_rspec_line', '$join']); 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 $Metadata(){}; var self = $Metadata = $klass($base, $super, 'Metadata', $Metadata); var def = self.$$proto, $scope = self.$$scope, TMP_9; $opal.defs(self, '$relative_path', function(line) { var self = this; try { line = line.$sub($scope.get('File').$expand_path("."), "."); line = line.$sub(/\A([^:]+:\d+)$/, "\\1"); if (line['$==']("-e:1")) { return nil}; return line; } catch ($err) {if ($opal.$rescue($err, [$scope.get('SecurityError')])) { return nil }else { throw $err; } }; }); $opal.defs(self, '$build_hash_from', function(args) { var $a, $b, self = this, hash = nil; hash = (function() {if ((($a = args.$last()['$is_a?']($scope.get('Hash'))) !== nil && (!$a.$$is_boolean || $a == true))) { return args.$pop() } else { return $hash2([], {}) }; return nil; })(); while ((($b = args.$last()['$is_a?']($scope.get('Symbol'))) !== nil && (!$b.$$is_boolean || $b == true))) { hash['$[]='](args.$pop(), true)}; return hash; }); (function($base) { var self = $module($base, 'MetadataHash'); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2; def['$[]'] = TMP_1 = function(key) {var $zuper = $slice.call(arguments, 0); var $a, self = this, $iter = TMP_1.$$p, $yield = $iter || nil; TMP_1.$$p = null; if ((($a = self['$has_key?'](key)) !== nil && (!$a.$$is_boolean || $a == true))) { } else { self.$store_computed(key) }; return $opal.find_super_dispatcher(self, '[]', TMP_1, $iter).apply(self, $zuper); }; def.$fetch = TMP_2 = function(key, args) {var $zuper = $slice.call(arguments, 0); var $a, self = this, $iter = TMP_2.$$p, $yield = $iter || nil; args = $slice.call(arguments, 1); TMP_2.$$p = null; if ((($a = self['$has_key?'](key)) !== nil && (!$a.$$is_boolean || $a == true))) { } else { self.$store_computed(key) }; return $opal.find_super_dispatcher(self, 'fetch', TMP_2, $iter).apply(self, $zuper); }; self.$private(); def.$store_computed = function(key) { var $a, self = this, $case = nil, file_path = nil, line_number = nil, klass = nil; return (function() {$case = key;if ("location"['$===']($case)) {return self.$store("location", self.$location())}else if ("file_path"['$===']($case) || "line_number"['$===']($case)) {$a = $opal.to_ary(self.$file_and_line_number()), file_path = ($a[0] == null ? nil : $a[0]), line_number = ($a[1] == null ? nil : $a[1]); self.$store("file_path", file_path); return self.$store("line_number", line_number);}else if ("execution_result"['$===']($case)) {return self.$store("execution_result", $hash2([], {}))}else if ("describes"['$===']($case) || "described_class"['$===']($case)) {klass = self.$described_class(); self.$store("described_class", klass); return self.$store("describes", klass);}else if ("full_description"['$===']($case)) {return self.$store("full_description", self.$full_description())}else if ("description"['$===']($case)) {return self.$store("description", ($a = self).$build_description_from.apply($a, [].concat(self['$[]']("description_args"))))}else if ("description_args"['$===']($case)) {return self.$store("description_args", [])}else { return nil }})(); }; def.$location = function() { var self = this; return "" + (self['$[]']("file_path")) + ":" + (self['$[]']("line_number")); }; def.$file_and_line_number = function() { var self = this; self.$first_caller_from_outside_rspec()['$=~'](/(.+?):(\d+)(|:\d+)/); return [$scope.get('Metadata').$relative_path(nil), nil.$to_i()]; }; def.$first_caller_from_outside_rspec = function() { var $a, $b, TMP_3, self = this; return ($a = ($b = self['$[]']("caller")).$detect, $a.$$p = (TMP_3 = function(l){var self = TMP_3.$$s || this, $a; if (l == null) l = nil; return ($a = l['$=~'](/\/lib\/rspec\/core/), ($a === nil || $a === false))}, TMP_3.$$s = self, TMP_3), $a).call($b); }; def['$method_description_after_module?'] = function(parent_part, child_part) { var $a, self = this; if ((($a = parent_part['$is_a?']($scope.get('Module'))) !== nil && (!$a.$$is_boolean || $a == true))) { } else { return false }; return child_part['$=~'](/^(#|::|\.)/); }; def.$build_description_from = function(first_part, parts) { var $a, $b, $c, TMP_4, self = this, description = nil, _ = nil; parts = $slice.call(arguments, 1); if (first_part == null) { first_part = "" } $a = $opal.to_ary(($b = ($c = parts).$inject, $b.$$p = (TMP_4 = function($d, this_part){var self = TMP_4.$$s || this, $a; desc = $d[0];last_part = $d[1];if (this_part == null) this_part = nil; this_part = this_part.$to_s(); if ((($a = self['$method_description_after_module?'](last_part, this_part)) !== nil && (!$a.$$is_boolean || $a == true))) { } else { this_part = (" "['$+'](this_part)) }; return [(desc['$+'](this_part)), this_part];}, TMP_4.$$s = self, TMP_4), $b).call($c, [first_part.$to_s(), first_part])), description = ($a[0] == null ? nil : $a[0]), _ = ($a[1] == null ? nil : $a[1]); return description; }; ;$opal.donate(self, ["$[]", "$fetch", "$store_computed", "$location", "$file_and_line_number", "$first_caller_from_outside_rspec", "$method_description_after_module?", "$build_description_from"]); })(self); (function($base) { var self = $module($base, 'ExampleMetadataHash'); var def = self.$$proto, $scope = self.$$scope; self.$include($scope.get('MetadataHash')); def.$described_class = function() { var self = this; return self['$[]']("example_group").$described_class(); }; def.$full_description = function() { var $a, self = this; return ($a = self).$build_description_from.apply($a, [self['$[]']("example_group")['$[]']("full_description")].concat(self['$[]']("description_args"))); }; ;$opal.donate(self, ["$described_class", "$full_description"]); })(self); (function($base) { var self = $module($base, 'GroupMetadataHash'); var def = self.$$proto, $scope = self.$$scope; self.$include($scope.get('MetadataHash')); def.$described_class = function() {try { var $a, $b, TMP_5, $c, TMP_7, self = this; ($a = ($b = self.$container_stack()).$each, $a.$$p = (TMP_5 = function(g){var self = TMP_5.$$s || this, $a, $b, TMP_6; if (g == null) g = nil; return ($a = ($b = ["described_class", "describes"]).$each, $a.$$p = (TMP_6 = function(key){var self = TMP_6.$$s || this, $a, value = nil; if (key == null) key = nil; if ((($a = g['$has_key?'](key)) !== nil && (!$a.$$is_boolean || $a == true))) { value = g['$[]'](key); if ((($a = value['$nil?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return nil } else { $opal.$return(value) }; } else { return nil }}, TMP_6.$$s = self, TMP_6), $a).call($b)}, TMP_5.$$s = self, TMP_5), $a).call($b); ($a = ($c = self.$container_stack().$reverse()).$each, $a.$$p = (TMP_7 = function(g){var self = TMP_7.$$s || this, $a, $b, candidate = nil; if (g == null) g = nil; candidate = g['$[]']("description_args").$first(); if ((($a = ((($b = $scope.get('String')['$==='](candidate)) !== false && $b !== nil) ? $b : $scope.get('Symbol')['$==='](candidate))) !== nil && (!$a.$$is_boolean || $a == true))) { return nil } else { $opal.$return(candidate) };}, TMP_7.$$s = self, TMP_7), $a).call($c); return nil; } catch ($returner) { if ($returner === $opal.returner) { return $returner.$v } throw $returner; } }; def.$full_description = function() { var $a, $b, $c, TMP_8, self = this; return ($a = self).$build_description_from.apply($a, [].concat(($b = ($c = $scope.get('FlatMap')).$flat_map, $b.$$p = (TMP_8 = function(a){var self = TMP_8.$$s || this; if (a == null) a = nil; return a['$[]']("description_args")}, TMP_8.$$s = self, TMP_8), $b).call($c, self.$container_stack().$reverse()))); }; def.$container_stack = function() { var $a, $b, $c, self = this, groups = nil, group = nil; if (self.container_stack == null) self.container_stack = nil; return ((($a = self.container_stack) !== false && $a !== nil) ? $a : self.container_stack = (function() {groups = [group = self]; while ((($c = group['$has_key?']("example_group")) !== nil && (!$c.$$is_boolean || $c == true))) { groups['$<<'](group['$[]']("example_group")); group = group['$[]']("example_group");}; return groups;})()); }; ;$opal.donate(self, ["$described_class", "$full_description", "$container_stack"]); })(self); def.$initialize = TMP_9 = function(parent_group_metadata) { var $a, self = this, $iter = TMP_9.$$p, $yield = $iter || nil; if (parent_group_metadata == null) { parent_group_metadata = nil } TMP_9.$$p = null; if (parent_group_metadata !== false && parent_group_metadata !== nil) { self.$update(parent_group_metadata); self.$store("example_group", $hash2(["example_group"], {"example_group": parent_group_metadata['$[]']("example_group").$extend($scope.get('GroupMetadataHash'))}).$extend($scope.get('GroupMetadataHash'))); } else { self.$store("example_group", $hash2([], {}).$extend($scope.get('GroupMetadataHash'))) }; if (($yield !== nil)) { return $a = $opal.$yield1($yield, self), $a === $breaker ? $a : $a } else { return nil }; }; def.$process = function(args) { var $a, self = this, user_metadata = nil; args = $slice.call(arguments, 0); user_metadata = (function() {if ((($a = args.$last()['$is_a?']($scope.get('Hash'))) !== nil && (!$a.$$is_boolean || $a == true))) { return args.$pop() } else { return $hash2([], {}) }; return nil; })(); self.$ensure_valid_keys(user_metadata); self['$[]']("example_group").$store("description_args", args); self['$[]']("example_group").$store("caller", ((($a = user_metadata.$delete("caller")) !== false && $a !== nil) ? $a : self.$caller())); return self.$update(user_metadata); }; def.$for_example = function(description, user_metadata) { var self = this; return self.$dup().$extend($scope.get('ExampleMetadataHash')).$configure_for_example(description, user_metadata); }; def['$any_apply?'] = function(filters) { var $a, $b, TMP_10, self = this; return ($a = ($b = filters)['$any?'], $a.$$p = (TMP_10 = function(k, v){var self = TMP_10.$$s || this; if (k == null) k = nil;if (v == null) v = nil; return self['$filter_applies?'](k, v)}, TMP_10.$$s = self, TMP_10), $a).call($b); }; def['$all_apply?'] = function(filters) { var $a, $b, TMP_11, self = this; return ($a = ($b = filters)['$all?'], $a.$$p = (TMP_11 = function(k, v){var self = TMP_11.$$s || this; if (k == null) k = nil;if (v == null) v = nil; return self['$filter_applies?'](k, v)}, TMP_11.$$s = self, TMP_11), $a).call($b); }; def['$filter_applies?'] = function(key, value, metadata) { var $a, $b, self = this, $case = nil; if (metadata == null) { metadata = self } if ((($a = ($b = $scope.get('Array')['$==='](metadata['$[]'](key)), $b !== false && $b !== nil ?($scope.get('Proc')['$==='](value))['$!']() : $b)) !== nil && (!$a.$$is_boolean || $a == true))) { return metadata['$filter_applies_to_any_value?'](key, value)}; if (key['$==']("line_numbers")) { return metadata['$line_number_filter_applies?'](value)}; if (key['$==']("locations")) { return metadata['$location_filter_applies?'](value)}; if ((($a = $scope.get('Hash')['$==='](value)) !== nil && (!$a.$$is_boolean || $a == true))) { return metadata['$filters_apply?'](key, value)}; if ((($a = metadata['$has_key?'](key)) !== nil && (!$a.$$is_boolean || $a == true))) { } else { return false }; return (function() {$case = value;if ($scope.get('Regexp')['$===']($case)) {return metadata['$[]'](key)['$=~'](value)}else if ($scope.get('Proc')['$===']($case)) {return (function() {$case = value.$arity();if ((0)['$===']($case)) {return value.$call()}else if ((2)['$===']($case)) {return value.$call(metadata['$[]'](key), metadata)}else {return value.$call(metadata['$[]'](key))}})()}else {return metadata['$[]'](key).$to_s()['$=='](value.$to_s())}})(); }; def['$filters_apply?'] = function(key, value) { var $a, $b, TMP_12, self = this; return ($a = ($b = value)['$all?'], $a.$$p = (TMP_12 = function(k, v){var self = TMP_12.$$s || this; if (k == null) k = nil;if (v == null) v = nil; return self['$filter_applies?'](k, v, self['$[]'](key))}, TMP_12.$$s = self, TMP_12), $a).call($b); }; def['$filter_applies_to_any_value?'] = function(key, value) { var $a, $b, TMP_13, self = this; return ($a = ($b = self['$[]'](key))['$any?'], $a.$$p = (TMP_13 = function(v){var self = TMP_13.$$s || this; if (v == null) v = nil; return self['$filter_applies?'](key, v, $hash(key, value))}, TMP_13.$$s = self, TMP_13), $a).call($b); }; def['$location_filter_applies?'] = function(locations) { var self = this, line_number = nil; line_number = self.$example_group_declaration_line(locations); if (line_number !== false && line_number !== nil) { return self['$line_number_filter_applies?'](line_number) } else { return true }; }; def['$line_number_filter_applies?'] = function(line_numbers) { var $a, $b, TMP_14, self = this, preceding_declaration_lines = nil; preceding_declaration_lines = ($a = ($b = line_numbers).$map, $a.$$p = (TMP_14 = function(n){var self = TMP_14.$$s || this; if (n == null) n = nil; return $scope.get('RSpec').$world().$preceding_declaration_line(n)}, TMP_14.$$s = self, TMP_14), $a).call($b); return (self.$relevant_line_numbers()['$&'](preceding_declaration_lines))['$empty?']()['$!'](); }; self.$protected(); def.$configure_for_example = function(description, user_metadata) { var $a, self = this; if (description !== false && description !== nil) { self.$store("description_args", [description])}; self.$store("caller", ((($a = user_metadata.$delete("caller")) !== false && $a !== nil) ? $a : self.$caller())); return self.$update(user_metadata); }; self.$private(); $opal.cdecl($scope, 'RESERVED_KEYS', ["description", "example_group", "execution_result", "file_path", "full_description", "line_number", "location"]); def.$ensure_valid_keys = function(user_metadata) { var $a, $b, TMP_15, self = this; return ($a = ($b = $scope.get('RESERVED_KEYS')).$each, $a.$$p = (TMP_15 = function(key){var self = TMP_15.$$s || this, $a; if (key == null) key = nil; if ((($a = user_metadata['$has_key?'](key)) !== nil && (!$a.$$is_boolean || $a == true))) { return self.$raise(" " + ("*"['$*'](50)) + "\n:" + (key) + " is not allowed\n\nRSpec reserves some hash keys for its own internal use,\nincluding :" + (key) + ", which is used on:\n\n " + ($scope.get('CallerFilter').$first_non_rspec_line()) + ".\n\nHere are all of RSpec's reserved hash keys:\n\n " + ($scope.get('RESERVED_KEYS').$join("\n ")) + "\n " + ("*"['$*'](50)) + "\n") } else { return nil }}, TMP_15.$$s = self, TMP_15), $a).call($b); }; def.$example_group_declaration_line = function(locations) { var $a, self = this; if ((($a = self['$[]']("example_group")) !== nil && (!$a.$$is_boolean || $a == true))) { return locations['$[]']($scope.get('File').$expand_path(self['$[]']("example_group")['$[]']("file_path"))) } else { return nil }; }; return (def.$relevant_line_numbers = function(metadata) { var $a, self = this; if (metadata == null) { metadata = self } return [metadata['$[]']("line_number")]['$+'](((function() {if ((($a = metadata['$[]']("example_group")) !== nil && (!$a.$$is_boolean || $a == true))) { return self.$relevant_line_numbers(metadata['$[]']("example_group")) } else { return [] }; return nil; })())); }, nil) && 'relevant_line_numbers'; })(self, $scope.get('Hash')) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/core/mocking/with_absolutely_nothing"] = 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, 'Core'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'MockFrameworkAdapter'); var def = self.$$proto, $scope = self.$$scope; def.$setup_mocks_for_rspec = function() { var self = this; return nil; }; def.$verify_mocks_for_rspec = function() { var self = this; return nil; }; def.$teardown_mocks_for_rspec = function() { var self = this; return nil; }; ;$opal.donate(self, ["$setup_mocks_for_rspec", "$verify_mocks_for_rspec", "$teardown_mocks_for_rspec"]); })(self) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/core/mocking/with_flexmock"] = 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(['$require', '$include', '$flexmock_verify', '$flexmock_close']); self.$require("flexmock/rspec"); 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, 'MockFrameworkAdapter'); var def = self.$$proto, $scope = self.$$scope; $opal.defs(self, '$framework_name', function() { var self = this; return "flexmock"; }); self.$include((($scope.get('FlexMock')).$$scope.get('MockContainer'))); def.$setup_mocks_for_rspec = function() { var self = this; return nil; }; def.$verify_mocks_for_rspec = function() { var self = this; return self.$flexmock_verify(); }; def.$teardown_mocks_for_rspec = function() { var self = this; return self.$flexmock_close(); }; ;$opal.donate(self, ["$setup_mocks_for_rspec", "$verify_mocks_for_rspec", "$teardown_mocks_for_rspec"]); })(self) })(self) })(self); }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/core/mocking/with_mocha"] = 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(['$require', '$include', '$mocha_setup', '$mocha_verify', '$mocha_teardown']); try { self.$require("mocha/api"); try { self.$require("mocha/object") } catch ($err) {if ($opal.$rescue($err, [$scope.get('LoadError')])) { nil }else { throw $err; } }; } catch ($err) {if ($opal.$rescue($err, [$scope.get('LoadError')])) { self.$require("mocha/standalone"); self.$require("mocha/object"); }else { throw $err; } }; 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, 'MockFrameworkAdapter'); var def = self.$$proto, $scope = self.$$scope; $opal.defs(self, '$framework_name', function() { var self = this; return "mocha"; }); try { self.$include((($scope.get('Mocha')).$$scope.get('API'))) } catch ($err) {if ($opal.$rescue($err, [$scope.get('NameError')])) { self.$include((($scope.get('Mocha')).$$scope.get('Standalone'))) }else { throw $err; } }; def.$setup_mocks_for_rspec = function() { var self = this; return self.$mocha_setup(); }; def.$verify_mocks_for_rspec = function() { var self = this; return self.$mocha_verify(); }; def.$teardown_mocks_for_rspec = function() { var self = this; return self.$mocha_teardown(); }; ;$opal.donate(self, ["$setup_mocks_for_rspec", "$verify_mocks_for_rspec", "$teardown_mocks_for_rspec"]); })(self) })(self) })(self); }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/core/mocking/with_rr"] = 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(['$require', '$push', '$backtrace_exclusion_patterns', '$configuration', '$include', '$reset', '$instance', '$verify_doubles']); self.$require("rr"); $scope.get('RSpec').$configuration().$backtrace_exclusion_patterns().$push((((($scope.get('RR')).$$scope.get('Errors'))).$$scope.get('BACKTRACE_IDENTIFIER'))); 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, 'MockFrameworkAdapter'); var def = self.$$proto, $scope = self.$$scope; $opal.defs(self, '$framework_name', function() { var self = this; return "rr"; }); self.$include((((($scope.get('RR')).$$scope.get('Extensions'))).$$scope.get('InstanceMethods'))); def.$setup_mocks_for_rspec = function() { var self = this; return (($scope.get('RR')).$$scope.get('Space')).$instance().$reset(); }; def.$verify_mocks_for_rspec = function() { var self = this; return (($scope.get('RR')).$$scope.get('Space')).$instance().$verify_doubles(); }; def.$teardown_mocks_for_rspec = function() { var self = this; return (($scope.get('RR')).$$scope.get('Space')).$instance().$reset(); }; ;$opal.donate(self, ["$setup_mocks_for_rspec", "$verify_mocks_for_rspec", "$teardown_mocks_for_rspec"]); })(self) })(self) })(self); }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/core/mocking/with_rspec"] = 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(['$require', '$configuration', '$setup', '$verify', '$teardown']); self.$require("rspec/mocks"); 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, 'MockFrameworkAdapter'); var def = self.$$proto, $scope = self.$$scope; $opal.defs(self, '$framework_name', function() { var self = this; return "rspec"; }); $opal.defs(self, '$configuration', function() { var self = this; return (($scope.get('RSpec')).$$scope.get('Mocks')).$configuration(); }); def.$setup_mocks_for_rspec = function() { var self = this; return (($scope.get('RSpec')).$$scope.get('Mocks')).$setup(self); }; def.$verify_mocks_for_rspec = function() { var self = this; return (($scope.get('RSpec')).$$scope.get('Mocks')).$verify(); }; def.$teardown_mocks_for_rspec = function() { var self = this; return (($scope.get('RSpec')).$$scope.get('Mocks')).$teardown(); }; ;$opal.donate(self, ["$setup_mocks_for_rspec", "$verify_mocks_for_rspec", "$teardown_mocks_for_rspec"]); })(self) })(self) })(self); }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/core/option_parser"] = 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, $range = $opal.range; $opal.add_stubs(['$require', '$parse!', '$new', '$alias_method', '$empty?', '$convert_deprecated_args', '$delete', '$parser', '$abort', '$message', '$map!', '$===', '$deprecate', '$banner=', '$on', '$[]', '$[]=', '$<<', '$to_i', '$run', '$exit', '$warning', '$separator', '$last', '$nil?', '$==', '$Integer', '$+', '$compile', '$escape', '$=~', '$split', '$gsub', '$to_sym', '$Float', '$puts', '$on_tail']); self.$require("optparse"); return (function($base) { var self = $module($base, 'Core'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Parser(){}; var self = $Parser = $klass($base, $super, 'Parser', $Parser); var def = self.$$proto, $scope = self.$$scope; $opal.defs(self, '$parse!', function(args) { var self = this; return self.$new()['$parse!'](args); }); (function(self) { var $scope = self.$$scope, def = self.$$proto; return self.$alias_method("parse", "parse!") })(self.$singleton_class()); def['$parse!'] = function(args) { var $a, self = this, options = nil, e = nil; if ((($a = args['$empty?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return $hash2([], {})}; self.$convert_deprecated_args(args); options = (function() {if ((($a = args.$delete("--tty")) !== nil && (!$a.$$is_boolean || $a == true))) { return $hash2(["tty"], {"tty": true}) } else { return $hash2([], {}) }; return nil; })(); try { self.$parser(options)['$parse!'](args) } catch ($err) {if ($opal.$rescue($err, [(($scope.get('OptionParser')).$$scope.get('InvalidOption'))])) {e = $err; self.$abort("" + (e.$message()) + "\n\nPlease use --help for a listing of valid options") }else { throw $err; } }; return options; }; def.$convert_deprecated_args = function(args) { var $a, $b, TMP_1, self = this; return ($a = ($b = args)['$map!'], $a.$$p = (TMP_1 = function(arg){var self = TMP_1.$$s || this, $case = nil; if (arg == null) arg = nil; return (function() {$case = arg;if ("--formatter"['$===']($case)) {$scope.get('RSpec').$deprecate("the --formatter option", $hash2(["replacement"], {"replacement": "-f or --format"})); return "--format";}else if ("--default_path"['$===']($case)) {return "--default-path"}else if ("--line_number"['$===']($case)) {return "--line-number"}else {return arg}})()}, TMP_1.$$s = self, TMP_1), $a).call($b); }; self.$alias_method("parse", "parse!"); return (def.$parser = function(options) { var $a, $b, TMP_2, self = this; return ($a = ($b = $scope.get('OptionParser')).$new, $a.$$p = (TMP_2 = function(parser){var self = TMP_2.$$s || this, $a, $b, TMP_3, $c, TMP_4, $d, TMP_5, $e, TMP_6, $f, TMP_7, $g, TMP_8, $h, TMP_9, $i, TMP_10, $j, TMP_11, $k, TMP_12, $l, TMP_13, $m, TMP_14, $n, TMP_15, $o, TMP_16, $p, TMP_17, $q, TMP_18, $r, TMP_19, $s, TMP_20, $t, TMP_21, $u, TMP_22, $v, TMP_23, $w, TMP_24, $x, TMP_25, $y, TMP_26, $z, TMP_27, $aa, TMP_28; if (parser == null) parser = nil; (($a = ["Usage: rspec [options] [files or directories]\n\n"]), $b = parser, $b['$banner='].apply($b, $a), $a[$a.length-1]); ($a = ($b = parser).$on, $a.$$p = (TMP_3 = function(dir){var self = TMP_3.$$s || this, $a, $b, $c; if (dir == null) dir = nil; ($a = "libs", $b = options, ((($c = $b['$[]']($a)) !== false && $c !== nil) ? $c : $b['$[]=']($a, []))); return options['$[]']("libs")['$<<'](dir);}, TMP_3.$$s = self, TMP_3), $a).call($b, "-I PATH", "Specify PATH to add to $LOAD_PATH (may be used more than once)."); ($a = ($c = parser).$on, $a.$$p = (TMP_4 = function(path){var self = TMP_4.$$s || this, $a, $b, $c; if (path == null) path = nil; ($a = "requires", $b = options, ((($c = $b['$[]']($a)) !== false && $c !== nil) ? $c : $b['$[]=']($a, []))); return options['$[]']("requires")['$<<'](path);}, TMP_4.$$s = self, TMP_4), $a).call($c, "-r", "--require PATH", "Require a file."); ($a = ($d = parser).$on, $a.$$p = (TMP_5 = function(path){var self = TMP_5.$$s || this; if (path == null) path = nil; return options['$[]=']("custom_options_file", path)}, TMP_5.$$s = self, TMP_5), $a).call($d, "-O", "--options PATH", "Specify the path to a custom options file."); ($a = ($e = parser).$on, $a.$$p = (TMP_6 = function(o){var self = TMP_6.$$s || this; if (o == null) o = nil; return options['$[]=']("order", o)}, TMP_6.$$s = self, TMP_6), $a).call($e, "--order TYPE[:SEED]", "Run examples by the specified order type.", " [defined] examples and groups are run in the order they are defined", " [rand] randomize the order of groups and examples", " [random] alias for rand", " [random:SEED] e.g. --order random:123"); ($a = ($f = parser).$on, $a.$$p = (TMP_7 = function(seed){var self = TMP_7.$$s || this; if (seed == null) seed = nil; return options['$[]=']("order", "rand:" + (seed))}, TMP_7.$$s = self, TMP_7), $a).call($f, "--seed SEED", $scope.get('Integer'), "Equivalent of --order rand:SEED."); ($a = ($g = parser).$on, $a.$$p = (TMP_8 = function(o){var self = TMP_8.$$s || this; if (o == null) o = nil; return options['$[]=']("fail_fast", true)}, TMP_8.$$s = self, TMP_8), $a).call($g, "--fail-fast", "Abort the run on first failure."); ($a = ($h = parser).$on, $a.$$p = (TMP_9 = function(o){var self = TMP_9.$$s || this; if (o == null) o = nil; return options['$[]=']("fail_fast", false)}, TMP_9.$$s = self, TMP_9), $a).call($h, "--no-fail-fast", "Do not abort the run on first failure."); ($a = ($i = parser).$on, $a.$$p = (TMP_10 = function(code){var self = TMP_10.$$s || this; if (code == null) code = nil; return options['$[]=']("failure_exit_code", code)}, TMP_10.$$s = self, TMP_10), $a).call($i, "--failure-exit-code CODE", $scope.get('Integer'), "Override the exit code used when there are failing specs."); ($a = ($j = parser).$on, $a.$$p = (TMP_11 = function(o){var self = TMP_11.$$s || this; if (o == null) o = nil; return options['$[]=']("dry_run", true)}, TMP_11.$$s = self, TMP_11), $a).call($j, "--dry-run", "Print the formatter output of your suite without", " running any examples or hooks"); ($a = ($k = parser).$on, $a.$$p = (TMP_12 = function(o){var self = TMP_12.$$s || this; if (o == null) o = nil; return options['$[]=']("drb", o)}, TMP_12.$$s = self, TMP_12), $a).call($k, "-X", "--[no-]drb", "Run examples via DRb."); ($a = ($l = parser).$on, $a.$$p = (TMP_13 = function(o){var self = TMP_13.$$s || this; if (o == null) o = nil; return options['$[]=']("drb_port", o.$to_i())}, TMP_13.$$s = self, TMP_13), $a).call($l, "--drb-port PORT", "Port to connect to the DRb server."); ($a = ($m = parser).$on, $a.$$p = (TMP_14 = function(cmd){var self = TMP_14.$$s || this; if (cmd == null) cmd = nil; self.$require("rspec/core/project_initializer"); $scope.get('ProjectInitializer').$new(cmd).$run(); return self.$exit();}, TMP_14.$$s = self, TMP_14), $a).call($m, "--init", "Initialize your project with RSpec."); ($a = ($n = parser).$on, $a.$$p = (TMP_15 = function(cmd){var self = TMP_15.$$s || this; if (cmd == null) cmd = nil; $scope.get('RSpec').$warning("--configure is deprecated with no effect. Use --init instead.", $hash2(["call_site"], {"call_site": nil})); return self.$exit();}, TMP_15.$$s = self, TMP_15), $a).call($n, "--configure", "Deprecated. Use --init instead."); parser.$separator("\n **** Output ****\n\n"); ($a = ($o = parser).$on, $a.$$p = (TMP_16 = function(o){var self = TMP_16.$$s || this, $a, $b, $c; if (o == null) o = nil; ($a = "formatters", $b = options, ((($c = $b['$[]']($a)) !== false && $c !== nil) ? $c : $b['$[]=']($a, []))); return options['$[]']("formatters")['$<<']([o]);}, TMP_16.$$s = self, TMP_16), $a).call($o, "-f", "--format FORMATTER", "Choose a formatter.", " [p]rogress (default - dots)", " [d]ocumentation (group and example names)", " [h]tml", " [j]son", " custom formatter class name"); ($a = ($p = parser).$on, $a.$$p = (TMP_17 = function(o){var self = TMP_17.$$s || this, $a, $b, $c; if (o == null) o = nil; ($a = "formatters", $b = options, ((($c = $b['$[]']($a)) !== false && $c !== nil) ? $c : $b['$[]=']($a, [["progress"]]))); return options['$[]']("formatters").$last()['$<<'](o);}, TMP_17.$$s = self, TMP_17), $a).call($p, "-o", "--out FILE", "Write output to a file instead of $stdout. This option applies", " to the previously specified --format, or the default format", " if no format is specified."); ($a = ($q = parser).$on, $a.$$p = (TMP_18 = function(o){var self = TMP_18.$$s || this; if (o == null) o = nil; return options['$[]=']("full_backtrace", true)}, TMP_18.$$s = self, TMP_18), $a).call($q, "-b", "--backtrace", "Enable full backtrace."); ($a = ($r = parser).$on, $a.$$p = (TMP_19 = function(o){var self = TMP_19.$$s || this; if (o == null) o = nil; return options['$[]=']("color", o)}, TMP_19.$$s = self, TMP_19), $a).call($r, "-c", "--[no-]color", "--[no-]colour", "Enable color in the output."); ($a = ($s = parser).$on, $a.$$p = (TMP_20 = function(argument){var self = TMP_20.$$s || this, $a; if (argument == null) argument = nil; return options['$[]=']("profile_examples", (function() {if ((($a = argument['$nil?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return true } else if (argument['$=='](false)) { return false } else { try { return self.$Integer(argument) } catch ($err) {if ($opal.$rescue($err, [$scope.get('ArgumentError')])) { $scope.get('RSpec').$warning("Non integer specified as profile count, seperate "['$+']("your path from options with -- e.g. ")['$+']("`rspec --profile -- " + (argument) + "`"), $hash2(["call_site"], {"call_site": nil})); return true; }else { throw $err; } } }; return nil; })())}, TMP_20.$$s = self, TMP_20), $a).call($s, "-p", "--[no-]profile [COUNT]", "Enable profiling of examples and list the slowest examples (default: 10)."); ($a = ($t = parser).$on, $a.$$p = (TMP_21 = function(){var self = TMP_21.$$s || this; return options['$[]=']("warnings", true)}, TMP_21.$$s = self, TMP_21), $a).call($t, "-w", "--warnings", "Enable ruby warnings"); parser.$separator("\n **** Filtering/tags ****\n\n In addition to the following options for selecting specific files, groups,\n or examples, you can select a single example by appending the line number to\n the filename:\n\n rspec path/to/a_spec.rb:37\n\n"); ($a = ($u = parser).$on, $a.$$p = (TMP_22 = function(o){var self = TMP_22.$$s || this; if (o == null) o = nil; return options['$[]=']("pattern", o)}, TMP_22.$$s = self, TMP_22), $a).call($u, "-P", "--pattern PATTERN", "Load files matching pattern (default: \"spec/**/*_spec.rb\")."); ($a = ($v = parser).$on, $a.$$p = (TMP_23 = function(o){var self = TMP_23.$$s || this, $a, $b, $c; if (o == null) o = nil; return (($a = "full_description", $b = options, ((($c = $b['$[]']($a)) !== false && $c !== nil) ? $c : $b['$[]=']($a, []))))['$<<']($scope.get('Regexp').$compile($scope.get('Regexp').$escape(o)))}, TMP_23.$$s = self, TMP_23), $a).call($v, "-e", "--example STRING", "Run examples whose full nested names include STRING (may be", " used more than once)"); ($a = ($w = parser).$on, $a.$$p = (TMP_24 = function(o){var self = TMP_24.$$s || this, $a, $b, $c; if (o == null) o = nil; return (($a = "line_numbers", $b = options, ((($c = $b['$[]']($a)) !== false && $c !== nil) ? $c : $b['$[]=']($a, []))))['$<<'](o)}, TMP_24.$$s = self, TMP_24), $a).call($w, "-l", "--line-number LINE", "Specify line number of an example or group (may be", " used more than once)."); ($a = ($x = parser).$on, $a.$$p = (TMP_25 = function(tag){var self = TMP_25.$$s || this, $a, $b, $c, filter_type = nil, name = nil, value = nil, $case = nil; if (tag == null) tag = nil; filter_type = (function() {if ((($a = tag['$=~'](/^~/)) !== nil && (!$a.$$is_boolean || $a == true))) { return "exclusion_filter" } else { return "inclusion_filter" }; return nil; })(); $a = $opal.to_ary(tag.$gsub(/^(~@|~|@)/, "").$split(":", 2)), name = ($a[0] == null ? nil : $a[0]), value = ($a[1] == null ? nil : $a[1]); name = name.$to_sym(); ($a = filter_type, $b = options, ((($c = $b['$[]']($a)) !== false && $c !== nil) ? $c : $b['$[]=']($a, $hash2([], {})))); return options['$[]'](filter_type)['$[]='](name, (function() {$case = value;if (nil['$===']($case)) {return true}else if ("true"['$===']($case)) {return true}else if ("false"['$===']($case)) {return false}else if ("nil"['$===']($case)) {return nil}else if (/^:/['$===']($case)) {return value['$[]']($range(1, -1, false)).$to_sym()}else if (/^\d+$/['$===']($case)) {return self.$Integer(value)}else if (/^\d+.\d+$/['$===']($case)) {return self.$Float(value)}else {return value}})());}, TMP_25.$$s = self, TMP_25), $a).call($x, "-t", "--tag TAG[:VALUE]", "Run examples with the specified tag, or exclude examples", "by adding ~ before the tag.", " - e.g. ~slow", " - TAG is always converted to a symbol"); ($a = ($y = parser).$on, $a.$$p = (TMP_26 = function(path){var self = TMP_26.$$s || this; if (path == null) path = nil; return options['$[]=']("default_path", path)}, TMP_26.$$s = self, TMP_26), $a).call($y, "--default-path PATH", "Set the default path where RSpec looks for examples (can", " be a path to a file or a directory)."); parser.$separator("\n **** Utility ****\n\n"); ($a = ($z = parser).$on, $a.$$p = (TMP_27 = function(){var self = TMP_27.$$s || this; self.$puts((((((($scope.get('RSpec')).$$scope.get('Core'))).$$scope.get('Version'))).$$scope.get('STRING'))); return self.$exit();}, TMP_27.$$s = self, TMP_27), $a).call($z, "-v", "--version", "Display the version."); return ($a = ($aa = parser).$on_tail, $a.$$p = (TMP_28 = function(){var self = TMP_28.$$s || this; self.$puts(parser); return self.$exit();}, TMP_28.$$s = self, TMP_28), $a).call($aa, "-h", "--help", "You're looking at it.");}, TMP_2.$$s = self, TMP_2), $a).call($b); }, nil) && 'parser'; })(self, null) })($scope.get('RSpec')); }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/core/ordering"] = 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', '$seed', '$shuffle', '$>', '$dup', '$times', '$+', '$rand', '$-', '$size', '$==', '$[]', '$[]=', '$call', '$register', '$fetch', '$to_proc', '$used?', '$attr_reader', '$used_random_seed?', '$ordering_registry', '$register_ordering', '$to_i', '$split', '$to_s', '$include?', '$has_key?', '$seed=', '$order=']); 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, $a; if ((($a = ($opal.Object.$$scope.Random == null ? nil : 'constant')) !== nil && (!$a.$$is_boolean || $a == true))) { $opal.cdecl($scope, 'RandomNumberGenerator', Opal.get('Random')) } else { self.$require("rspec/core/backport_random"); $opal.cdecl($scope, 'RandomNumberGenerator', (((((($scope.get('RSpec')).$$scope.get('Core'))).$$scope.get('Backports'))).$$scope.get('Random'))); }; (function($base) { var self = $module($base, 'Ordering'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Identity(){}; var self = $Identity = $klass($base, $super, 'Identity', $Identity); var def = self.$$proto, $scope = self.$$scope; return (def.$order = function(items) { var self = this; return items; }, nil) && 'order' })(self, null); (function($base, $super) { function $Random(){}; var self = $Random = $klass($base, $super, 'Random', $Random); var def = self.$$proto, $scope = self.$$scope; def.used = def.configuration = nil; def.$initialize = function(configuration) { var self = this; self.configuration = configuration; return self.used = false; }; def['$used?'] = function() { var self = this; return self.used; }; def.$order = function(items) { var self = this, rng = nil; self.used = true; rng = $scope.get('RandomNumberGenerator').$new(self.configuration.$seed()); return self.$shuffle(items, rng); }; if ($scope.get('RUBY_VERSION')['$>']("1.9.3")) { return (def.$shuffle = function(list, rng) { var self = this; return list.$shuffle($hash2(["random"], {"random": rng})); }, nil) && 'shuffle' } else { return (def.$shuffle = function(list, rng) { var $a, $b, TMP_1, self = this, shuffled = nil; shuffled = list.$dup(); ($a = ($b = shuffled.$size()).$times, $a.$$p = (TMP_1 = function(i){var self = TMP_1.$$s || this, $a, j = nil; if (i == null) i = nil; j = i['$+'](rng.$rand(shuffled.$size()['$-'](i))); if (i['$=='](j)) { return nil;}; return $a = [shuffled['$[]'](j), shuffled['$[]'](i)], shuffled['$[]='](i, $a[0]), shuffled['$[]='](j, $a[1]);}, TMP_1.$$s = self, TMP_1), $a).call($b); return shuffled; }, nil) && 'shuffle' }; })(self, null); (function($base, $super) { function $Custom(){}; var self = $Custom = $klass($base, $super, 'Custom', $Custom); var def = self.$$proto, $scope = self.$$scope; def.callable = nil; def.$initialize = function(callable) { var self = this; return self.callable = callable; }; return (def.$order = function(list) { var self = this; return self.callable.$call(list); }, nil) && 'order'; })(self, null); (function($base, $super) { function $Registry(){}; var self = $Registry = $klass($base, $super, 'Registry', $Registry); var def = self.$$proto, $scope = self.$$scope, TMP_2; def.strategies = nil; def.$initialize = function(configuration) { var self = this, identity = nil; self.configuration = configuration; self.strategies = $hash2([], {}); self.$register("random", $scope.get('Random').$new(configuration)); identity = $scope.get('Identity').$new(); self.$register("defined", identity); return self.$register("global", identity); }; def.$fetch = TMP_2 = function(name) { var $a, $b, self = this, $iter = TMP_2.$$p, fallback = $iter || nil; TMP_2.$$p = null; return ($a = ($b = self.strategies).$fetch, $a.$$p = fallback.$to_proc(), $a).call($b, name); }; def.$register = function(sym, strategy) { var self = this; return self.strategies['$[]='](sym, strategy); }; return (def['$used_random_seed?'] = function() { var self = this; return self.strategies['$[]']("random")['$used?'](); }, nil) && 'used_random_seed?'; })(self, null); (function($base, $super) { function $ConfigurationManager(){}; var self = $ConfigurationManager = $klass($base, $super, 'ConfigurationManager', $ConfigurationManager); var def = self.$$proto, $scope = self.$$scope, TMP_4; def.seed_forced = def.order_forced = nil; self.$attr_reader("seed", "ordering_registry"); def.$initialize = function() { var self = this; self.ordering_registry = $scope.get('Registry').$new(self); self.seed = self.$rand(65535); self.seed_forced = false; return self.order_forced = false; }; def['$seed_used?'] = function() { var self = this; return self.$ordering_registry()['$used_random_seed?'](); }; def['$seed='] = function(seed) { var $a, self = this; if ((($a = self.seed_forced) !== nil && (!$a.$$is_boolean || $a == true))) { return nil}; self.$register_ordering("global", self.$ordering_registry().$fetch("random")); return self.seed = seed.$to_i(); }; def['$order='] = function(type) { var $a, self = this, order = nil, seed = nil, ordering_name = nil; $a = $opal.to_ary(type.$to_s().$split(":")), order = ($a[0] == null ? nil : $a[0]), seed = ($a[1] == null ? nil : $a[1]); if (seed !== false && seed !== nil) { self.seed = seed = seed.$to_i()}; ordering_name = (function() {if ((($a = order['$include?']("rand")) !== nil && (!$a.$$is_boolean || $a == true))) { return "random" } else if (order['$==']("defined")) { return "defined" } else { return nil }; return nil; })(); if (ordering_name !== false && ordering_name !== nil) { return self.$register_ordering("global", self.$ordering_registry().$fetch(ordering_name)) } else { return nil }; }; def.$force = function(hash) { var $a, $b, self = this; if ((($a = hash['$has_key?']("seed")) !== nil && (!$a.$$is_boolean || $a == true))) { (($a = [hash['$[]']("seed")]), $b = self, $b['$seed='].apply($b, $a), $a[$a.length-1]); self.seed_forced = true; return self.order_forced = true; } else if ((($a = hash['$has_key?']("order")) !== nil && (!$a.$$is_boolean || $a == true))) { (($a = [hash['$[]']("order")]), $b = self, $b['$order='].apply($b, $a), $a[$a.length-1]); return self.order_forced = true; } else { return nil }; }; return (def.$register_ordering = TMP_4 = function(name, strategy) { var $a, $b, self = this, TMP_3, $iter = TMP_4.$$p, $yield = $iter || nil; if (strategy == null) { strategy = $scope.get('Custom').$new(($a = ($b = $scope.get('Proc')).$new, $a.$$p = (TMP_3 = function(l){var self = TMP_3.$$s || this, $a; if (l == null) l = nil; return $a = $opal.$yield1($yield, l), $a === $breaker ? $a : $a}, TMP_3.$$s = self, TMP_3), $a).call($b)) } TMP_4.$$p = null; if ((($a = ($b = self.order_forced, $b !== false && $b !== nil ?name['$==']("global") : $b)) !== nil && (!$a.$$is_boolean || $a == true))) { return nil}; return self.$ordering_registry().$register(name, strategy); }, nil) && 'register_ordering'; })(self, null); })(self); })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/core/pending"] = 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(['$current_example', '$before', '$pending', '$class', '$is_a?', '$last', '$pop', '$first', '$[]', '$has_key?', '$!', '$[]=', '$metadata', '$execution_result', '$instance_eval', '$verify_mocks_for_rspec', '$example_group_instance', '$teardown_mocks_for_rspec', '$raise', '$new']); 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, 'Pending'); var def = self.$$proto, $scope = self.$$scope, TMP_2; (function($base, $super) { function $PendingDeclaredInExample(){}; var self = $PendingDeclaredInExample = $klass($base, $super, 'PendingDeclaredInExample', $PendingDeclaredInExample); var def = self.$$proto, $scope = self.$$scope; return nil; })(self, $scope.get('StandardError')); try { (function($base, $super) { function $PendingExampleFixedError(){}; var self = $PendingExampleFixedError = $klass($base, $super, 'PendingExampleFixedError', $PendingExampleFixedError); var def = self.$$proto, $scope = self.$$scope; return nil; })(self, (((($scope.get('Test')).$$scope.get('Unit'))).$$scope.get('AssertionFailedError'))) } catch ($err) {if (true) { (function($base, $super) { function $PendingExampleFixedError(){}; var self = $PendingExampleFixedError = $klass($base, $super, 'PendingExampleFixedError', $PendingExampleFixedError); var def = self.$$proto, $scope = self.$$scope; return nil; })(self, $scope.get('StandardError')) }else { throw $err; } }; $opal.cdecl($scope, 'NO_REASON_GIVEN', "No reason given"); $opal.cdecl($scope, 'NOT_YET_IMPLEMENTED', "Not yet implemented"); def.$pending = TMP_2 = function(args) { var $a, $b, TMP_1, $c, $d, TMP_3, self = this, $iter = TMP_2.$$p, $yield = $iter || nil, current_example = nil, options = nil, message = nil, result = nil, e = nil; args = $slice.call(arguments, 0); TMP_2.$$p = null; current_example = $scope.get('RSpec').$current_example(); if (current_example !== false && current_example !== nil) { } else { return ($a = ($b = self.$class()).$before, $a.$$p = (TMP_1 = function(){var self = TMP_1.$$s || this, $a; return ($a = self).$pending.apply($a, [].concat(args))}, TMP_1.$$s = self, TMP_1), $a).call($b, "each") }; options = (function() {if ((($a = args.$last()['$is_a?']($scope.get('Hash'))) !== nil && (!$a.$$is_boolean || $a == true))) { return args.$pop() } else { return $hash2([], {}) }; return nil; })(); message = ((($a = args.$first()) !== false && $a !== nil) ? $a : $scope.get('NO_REASON_GIVEN')); if ((($a = ((($c = options['$[]']("unless")) !== false && $c !== nil) ? $c : (($d = options['$has_key?']("if"), $d !== false && $d !== nil ?options['$[]']("if")['$!']() : $d)))) !== nil && (!$a.$$is_boolean || $a == true))) { return (function() {if (($yield !== nil)) { return $a = $opal.$yieldX($yield, []), $a === $breaker ? $a : $a } else { return nil }; return nil; })()}; current_example.$metadata()['$[]=']("pending", true); current_example.$metadata()['$[]']("execution_result")['$[]=']("pending_message", message); current_example.$execution_result()['$[]=']("pending_fixed", false); if (($yield !== nil)) { try { try { result = (function() {if ($opal.$yieldX($yield, []) === $breaker) return $breaker.$v; return ($a = ($c = current_example.$example_group_instance()).$instance_eval, $a.$$p = (TMP_3 = function(){var self = TMP_3.$$s || this; return self.$verify_mocks_for_rspec()}, TMP_3.$$s = self, TMP_3), $a).call($c);})(); current_example.$metadata()['$[]=']("pending", false); } catch ($err) {if ($opal.$rescue($err, [$scope.get('Exception')])) {e = $err; current_example.$execution_result()['$[]=']("exception", e) }else { throw $err; } } } finally { self.$teardown_mocks_for_rspec() }; if (result !== false && result !== nil) { current_example.$execution_result()['$[]=']("pending_fixed", true); self.$raise($scope.get('PendingExampleFixedError').$new());};}; return self.$raise($scope.get('PendingDeclaredInExample').$new(message)); }; ;$opal.donate(self, ["$pending"]); })(self) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/core/project_initializer"] = 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(['$create_spec_helper_file', '$create_dot_rspec_file', '$delete_if_confirmed', '$exist?', '$report_exists', '$report_creating', '$open', '$write', '$mkdir_p', '$puts', '$=~', '$gets', '$rm_rf']); 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 $ProjectInitializer(){}; var self = $ProjectInitializer = $klass($base, $super, 'ProjectInitializer', $ProjectInitializer); var def = self.$$proto, $scope = self.$$scope; def.$initialize = function(arg) { var self = this; if (arg == null) { arg = nil } return self.arg = arg; }; def.$run = function() { var self = this; self.$create_spec_helper_file(); self.$create_dot_rspec_file(); return self.$delete_if_confirmed("lib/tasks/rspec.rake", " If the file in lib/tasks/rspec.rake is the one generated by rspec-rails-1x,\n you can get rid of it, as it is no longer needed with rspec-2.\n"); }; def.$create_dot_rspec_file = function() { var $a, $b, TMP_1, self = this; if ((($a = $scope.get('File')['$exist?'](".rspec")) !== nil && (!$a.$$is_boolean || $a == true))) { return self.$report_exists(".rspec") } else { self.$report_creating(".rspec"); return ($a = ($b = $scope.get('File')).$open, $a.$$p = (TMP_1 = function(f){var self = TMP_1.$$s || this; if (f == null) f = nil; return f.$write("--color\n--format progress\n")}, TMP_1.$$s = self, TMP_1), $a).call($b, ".rspec", "w"); }; }; def.$create_spec_helper_file = function() { var $a, $b, TMP_2, self = this; if ((($a = $scope.get('File')['$exist?']("spec/spec_helper.rb")) !== nil && (!$a.$$is_boolean || $a == true))) { return self.$report_exists("spec/spec_helper.rb") } else { self.$report_creating("spec/spec_helper.rb"); $scope.get('FileUtils').$mkdir_p("spec"); return ($a = ($b = $scope.get('File')).$open, $a.$$p = (TMP_2 = function(f){var self = TMP_2.$$s || this; if (f == null) f = nil; return f.$write("# This file was generated by the `rspec --init` command. Conventionally, all\n# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.\n# Require this file using `require \"spec_helper\"` to ensure that it is only\n# loaded once.\n#\n# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration\nRSpec.configure do |config|\n # Limit the spec run to only specs with the focus metadata. If no specs have\n # the filtering metadata and `run_all_when_everything_filtered = true` then\n # all specs will run.\n #config.filter_run :focus\n\n # Run all specs when none match the provided filter. This works well in\n # conjunction with `config.filter_run :focus`, as it will run the entire\n # suite when no specs have `:filter` metadata.\n #config.run_all_when_everything_filtered = true\n\n # Run specs in random order to surface order dependencies. If you find an\n # order dependency and want to debug it, you can fix the order by providing\n # the seed, which is printed after each run.\n # --seed 1234\n #config.order = 'random'\nend\n")}, TMP_2.$$s = self, TMP_2), $a).call($b, "spec/spec_helper.rb", "w"); }; }; def.$delete_if_confirmed = function(path, message) { var $a, self = this; if ((($a = $scope.get('File')['$exist?'](path)) !== nil && (!$a.$$is_boolean || $a == true))) { self.$puts(); self.$puts(message); self.$puts(); self.$puts(" delete " + (path) + "? [y/n]"); if ((($a = self.$gets()['$=~'](/y/i)) !== nil && (!$a.$$is_boolean || $a == true))) { return $scope.get('FileUtils').$rm_rf(path) } else { return nil }; } else { return nil }; }; def.$report_exists = function(file) { var self = this; return self.$puts(" exist " + (file)); }; return (def.$report_creating = function(file) { var self = this; return self.$puts(" create " + (file)); }, nil) && 'report_creating'; })(self, null) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/core/rake_task"] = 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', '$include', '$attr_accessor', '$deprecate', '$setup_ivars', '$last_comment', '$application', '$desc', '$task', '$send', '$call', '$slice', '$arity', '$run_task', '$verbose', '$name', '$shift', '$spec_command', '$puts', '$system', '$failure_message', '$fail_on_error', '$abort', '$private', '$[]', '$sort', '$map', '$to_proc', '$pattern', '$<<', '$ruby_opts', '$rspec_path', '$files_to_run', '$rspec_opts', '$join', '$reject', '$blank', '$flatten', '$lambda', '$nil?', '$==']); self.$require("rspec/support/warnings"); self.$require("rake"); self.$require("rake/tasklib"); 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 $RakeTask(){}; var self = $RakeTask = $klass($base, $super, 'RakeTask', $RakeTask); var def = self.$$proto, $scope = self.$$scope, $a, TMP_1; if ((($a = (function(){ try { return ((((Opal.get('Rake')).$$scope.get('DSL'))) != null ? 'constant' : nil); } catch (err) { if (err.$$class === Opal.NameError) { return nil; } else { throw(err); }}; })()) !== nil && (!$a.$$is_boolean || $a == true))) { self.$include(((Opal.get('Rake')).$$scope.get('DSL')))}; self.$attr_accessor("name"); self.$attr_accessor("pattern"); self.$attr_accessor("fail_on_error"); self.$attr_accessor("failure_message"); self.$attr_accessor("verbose"); self.$attr_accessor("ruby_opts"); self.$attr_accessor("rspec_path"); self.$attr_accessor("rspec_opts"); def['$spec_opts='] = function(opts) { var self = this; $scope.get('RSpec').$deprecate("RSpec::Core::RakeTask#spec_opts=", $hash2(["replacement"], {"replacement": "rspec_opts="})); return self.rspec_opts = opts; }; def.$initialize = TMP_1 = function(args) { var $a, $b, TMP_2, self = this, $iter = TMP_1.$$p, task_block = $iter || nil; args = $slice.call(arguments, 0); TMP_1.$$p = null; self.$setup_ivars(args); if ((($a = Opal.get('Rake').$application().$last_comment()) !== nil && (!$a.$$is_boolean || $a == true))) { } else { self.$desc("Run RSpec code examples") }; return ($a = ($b = self).$task, $a.$$p = (TMP_2 = function(_, task_args){var self = TMP_2.$$s || this, $a, $b, TMP_3; if (_ == null) _ = nil;if (task_args == null) task_args = nil; return ($a = ($b = $scope.get('RakeFileUtils')).$send, $a.$$p = (TMP_3 = function(){var self = TMP_3.$$s || this, $a; if (task_block !== false && task_block !== nil) { ($a = task_block).$call.apply($a, [].concat([self, task_args].$slice(0, task_block.$arity())))}; return self.$run_task(self.$verbose());}, TMP_3.$$s = self, TMP_3), $a).call($b, "verbose", self.$verbose())}, TMP_2.$$s = self, TMP_2), $a).apply($b, [self.$name()].concat(args)); }; def.$setup_ivars = function(args) { var $a, self = this; self.name = ((($a = args.$shift()) !== false && $a !== nil) ? $a : "spec"); $a = [nil, nil, nil], self.ruby_opts = $a[0], self.rspec_opts = $a[1]; $a = [true, true], self.verbose = $a[0], self.fail_on_error = $a[1]; self.rspec_path = "rspec"; return self.pattern = "./spec{,/*/**}/*_spec.rb"; }; def.$run_task = function(verbose) { var $a, self = this, command = nil, success = nil; command = self.$spec_command(); try { if (verbose !== false && verbose !== nil) { self.$puts(command)}; success = self.$system(command); } catch ($err) {if (true) { if ((($a = self.$failure_message()) !== nil && (!$a.$$is_boolean || $a == true))) { self.$puts(self.$failure_message())} }else { throw $err; } }; if (success !== false && success !== nil) { return nil } else if ((($a = self.$fail_on_error()) !== nil && (!$a.$$is_boolean || $a == true))) { return self.$abort("" + (command) + " failed") } else { return nil }; }; self.$private(); def.$files_to_run = function() { var $a, $b, self = this; if ((($a = $scope.get('ENV')['$[]']("SPEC")) !== nil && (!$a.$$is_boolean || $a == true))) { return $scope.get('FileList')['$[]']($scope.get('ENV')['$[]']("SPEC")).$sort() } else { return ($a = ($b = $scope.get('FileList')['$[]'](self.$pattern()).$sort()).$map, $a.$$p = "shellescape".$to_proc(), $a).call($b) }; }; def.$spec_command = function() { var $a, $b, self = this, cmd_parts = nil; cmd_parts = []; cmd_parts['$<<']($scope.get('RUBY')); cmd_parts['$<<'](self.$ruby_opts()); cmd_parts['$<<']("-S")['$<<'](self.$rspec_path()); cmd_parts['$<<'](self.$files_to_run()); cmd_parts['$<<'](self.$rspec_opts()); return ($a = ($b = cmd_parts.$flatten()).$reject, $a.$$p = self.$blank().$to_proc(), $a).call($b).$join(" "); }; return (def.$blank = function() { var $a, $b, TMP_4, self = this; return ($a = ($b = self).$lambda, $a.$$p = (TMP_4 = function(s){var self = TMP_4.$$s || this, $a; if (s == null) s = nil; return ((($a = s['$nil?']()) !== false && $a !== nil) ? $a : s['$=='](""))}, TMP_4.$$s = self, TMP_4), $a).call($b); }, nil) && 'blank'; })(self, ((Opal.get('Rake')).$$scope.get('TaskLib'))) })(self) })(self); }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/core/reporter"] = 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(['$map', '$to_proc', '$new', '$[]=', '$each', '$register_listener', '$respond_to?', '$<<', '$[]', '$to_sym', '$start', '$finish', '$now', '$notify', '$empty?', '$descendant_filtered_examples', '$+', '$stop', '$seed_used?', '$seed', '$alias_method', '$to_f', '$-', '$send', '$registered_listeners', '$private']); return (function($base) { var self = $module($base, 'Core'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Reporter(){}; var self = $Reporter = $klass($base, $super, 'Reporter', $Reporter); var def = self.$$proto, $scope = self.$$scope, $a, $b, TMP_4, TMP_5; def.listeners = def.example_count = def.failure_count = def.pending_count = def.duration = def.configuration = def.start = nil; $opal.cdecl($scope, 'NOTIFICATIONS', ($a = ($b = ["start", "message", "example_group_started", "example_group_finished", "example_started", "example_passed", "example_failed", "example_pending", "start_dump", "dump_pending", "dump_failures", "dump_summary", "seed", "close", "stop", "deprecation", "deprecation_summary"]).$map, $a.$$p = "to_sym".$to_proc(), $a).call($b)); def.$initialize = function(configuration, formatters) { var $a, $b, TMP_1, $c, TMP_2, self = this; formatters = $slice.call(arguments, 1); self.configuration = configuration; self.listeners = ($a = ($b = $scope.get('Hash')).$new, $a.$$p = (TMP_1 = function(h, k){var self = TMP_1.$$s || this; if (h == null) h = nil;if (k == null) k = nil; return h['$[]='](k, [])}, TMP_1.$$s = self, TMP_1), $a).call($b); ($a = ($c = formatters).$each, $a.$$p = (TMP_2 = function(formatter){var self = TMP_2.$$s || this, $a; if (formatter == null) formatter = nil; return ($a = self).$register_listener.apply($a, [formatter].concat($scope.get('NOTIFICATIONS')))}, TMP_2.$$s = self, TMP_2), $a).call($c); self.example_count = self.failure_count = self.pending_count = 0; return self.duration = self.start = nil; }; def.$register_listener = function(listener, notifications) { var $a, $b, TMP_3, self = this; notifications = $slice.call(arguments, 1); ($a = ($b = notifications).$each, $a.$$p = (TMP_3 = function(notification){var self = TMP_3.$$s || this, $a; if (self.listeners == null) self.listeners = nil; if (notification == null) notification = nil; if ((($a = listener['$respond_to?'](notification)) !== nil && (!$a.$$is_boolean || $a == true))) { return self.listeners['$[]'](notification.$to_sym())['$<<'](listener) } else { return nil }}, TMP_3.$$s = self, TMP_3), $a).call($b); return true; }; def.$registered_listeners = function(notification) { var self = this; return self.listeners['$[]'](notification); }; def.$report = TMP_4 = function(expected_example_count) { var $a, self = this, $iter = TMP_4.$$p, $yield = $iter || nil; TMP_4.$$p = null; self.$start(expected_example_count); try { return $a = $opal.$yield1($yield, self), $a === $breaker ? $a : $a } finally { self.$finish() }; }; def.$start = function(expected_example_count) { var self = this; self.start = (((($scope.get('RSpec')).$$scope.get('Core'))).$$scope.get('Time')).$now(); return self.$notify("start", expected_example_count); }; def.$message = function(message) { var self = this; return self.$notify("message", message); }; def.$example_group_started = function(group) { var $a, self = this; if ((($a = group.$descendant_filtered_examples()['$empty?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return nil } else { return self.$notify("example_group_started", group) }; }; def.$example_group_finished = function(group) { var $a, self = this; if ((($a = group.$descendant_filtered_examples()['$empty?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return nil } else { return self.$notify("example_group_finished", group) }; }; def.$example_started = function(example) { var self = this; self.example_count = self.example_count['$+'](1); return self.$notify("example_started", example); }; def.$example_passed = function(example) { var self = this; return self.$notify("example_passed", example); }; def.$example_failed = function(example) { var self = this; self.failure_count = self.failure_count['$+'](1); return self.$notify("example_failed", example); }; def.$example_pending = function(example) { var self = this; self.pending_count = self.pending_count['$+'](1); return self.$notify("example_pending", example); }; def.$deprecation = function(message) { var self = this; return self.$notify("deprecation", message); }; def.$finish = function() { var $a, self = this; try { self.$stop(); self.$notify("start_dump"); self.$notify("dump_pending"); self.$notify("dump_failures"); self.$notify("dump_summary", self.duration, self.example_count, self.failure_count, self.pending_count); self.$notify("deprecation_summary"); if ((($a = self['$seed_used?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return self.$notify("seed", self.configuration.$seed()) } else { return nil }; } finally { self.$notify("close") }; }; self.$alias_method("abort", "finish"); def.$stop = function() { var $a, self = this; if ((($a = self.start) !== nil && (!$a.$$is_boolean || $a == true))) { self.duration = ((((($scope.get('RSpec')).$$scope.get('Core'))).$$scope.get('Time')).$now()['$-'](self.start)).$to_f()}; return self.$notify("stop"); }; def.$notify = TMP_5 = function(event, args) { var $a, $b, TMP_6, self = this, $iter = TMP_5.$$p, block = $iter || nil; args = $slice.call(arguments, 1); TMP_5.$$p = null; return ($a = ($b = self.$registered_listeners(event)).$each, $a.$$p = (TMP_6 = function(formatter){var self = TMP_6.$$s || this, $a, $b; if (formatter == null) formatter = nil; return ($a = ($b = formatter).$send, $a.$$p = block.$to_proc(), $a).apply($b, [event].concat(args))}, TMP_6.$$s = self, TMP_6), $a).call($b); }; self.$private(); return (def['$seed_used?'] = function() { var $a, self = this; return ($a = self.configuration.$seed(), $a !== false && $a !== nil ?self.configuration['$seed_used?']() : $a); }, nil) && 'seed_used?'; })(self, null) })($scope.get('RSpec')) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/core/ruby_project"] = 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, $gvars = $opal.gvars; $opal.add_stubs(['$require', '$map', '$add_dir_to_load_path', '$join', '$root', '$include?', '$unshift', '$determine_root', '$find_first_parent_containing', '$ascend_until', '$exists?', '$ascend', '$Pathname', '$expand_path', '$module_function']); self.$require("pathname"); 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, 'RubyProject'); var def = self.$$proto, $scope = self.$$scope, TMP_4; def.$add_to_load_path = function(dirs) { var $a, $b, TMP_1, self = this; dirs = $slice.call(arguments, 0); return ($a = ($b = dirs).$map, $a.$$p = (TMP_1 = function(dir){var self = TMP_1.$$s || this; if (dir == null) dir = nil; return self.$add_dir_to_load_path($scope.get('File').$join(self.$root(), dir))}, TMP_1.$$s = self, TMP_1), $a).call($b); }; def.$add_dir_to_load_path = function(dir) { var $a, self = this; if ($gvars.LOAD_PATH == null) $gvars.LOAD_PATH = nil; if ((($a = $gvars.LOAD_PATH['$include?'](dir)) !== nil && (!$a.$$is_boolean || $a == true))) { return nil } else { return $gvars.LOAD_PATH.$unshift(dir) }; }; def.$root = function() { var $a, self = this; if (self.project_root == null) self.project_root = nil; return ((($a = self.project_root) !== false && $a !== nil) ? $a : self.project_root = self.$determine_root()); }; def.$determine_root = function() { var $a, self = this; return ((($a = self.$find_first_parent_containing("spec")) !== false && $a !== nil) ? $a : "."); }; def.$find_first_parent_containing = function(dir) { var $a, $b, TMP_2, self = this; return ($a = ($b = self).$ascend_until, $a.$$p = (TMP_2 = function(path){var self = TMP_2.$$s || this; if (path == null) path = nil; return $scope.get('File')['$exists?']($scope.get('File').$join(path, dir))}, TMP_2.$$s = self, TMP_2), $a).call($b); }; def.$ascend_until = TMP_4 = function() {try { var $a, $b, TMP_3, self = this, $iter = TMP_4.$$p, $yield = $iter || nil; TMP_4.$$p = null; return ($a = ($b = self.$Pathname($scope.get('File').$expand_path("."))).$ascend, $a.$$p = (TMP_3 = function(path){var self = TMP_3.$$s || this, $a, $b; if (path == null) path = nil; if ((($a = ((($b = $opal.$yield1($yield, path)) === $breaker) ? $breaker.$v : $b)) !== nil && (!$a.$$is_boolean || $a == true))) { $opal.$return(path) } else { return nil }}, TMP_3.$$s = self, TMP_3), $a).call($b); } catch ($returner) { if ($returner === $opal.returner) { return $returner.$v } throw $returner; } }; self.$module_function("add_to_load_path"); self.$module_function("add_dir_to_load_path"); self.$module_function("root"); self.$module_function("determine_root"); self.$module_function("find_first_parent_containing"); self.$module_function("ascend_until"); ;$opal.donate(self, ["$add_to_load_path", "$add_dir_to_load_path", "$root", "$determine_root", "$find_first_parent_containing", "$ascend_until"]); })(self) })(self) })(self); }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/core/runner"] = 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(['$autorun_disabled?', '$installed_at_exit?', '$running_in_drb?', '$at_exit', '$nil?', '$kind_of?', '$to_i', '$run', '$!', '$==', '$exit', '$-', '$current_server', '$require', '$getaddress', '$gethostname', '$any?', '$host', '$URI', '$uri', '$trap', '$wants_to_quit', '$exit!', '$wants_to_quit=', '$puts', '$trap_interrupt', '$new', '$parse_options', '$[]', '$options', '$reset']); 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 $Runner(){}; var self = $Runner = $klass($base, $super, 'Runner', $Runner); var def = self.$$proto, $scope = self.$$scope; $opal.defs(self, '$autorun', function() { var $a, $b, $c, TMP_1, self = this; if ((($a = ((($b = ((($c = self['$autorun_disabled?']()) !== false && $c !== nil) ? $c : self['$installed_at_exit?']())) !== false && $b !== nil) ? $b : self['$running_in_drb?']())) !== nil && (!$a.$$is_boolean || $a == true))) { return nil}; ($a = ($b = self).$at_exit, $a.$$p = (TMP_1 = function(){var self = TMP_1.$$s || this, $a, $b, status = nil; if ($gvars["!"] == null) $gvars["!"] = nil; if ($gvars.stderr == null) $gvars.stderr = nil; if ($gvars.stdout == null) $gvars.stdout = nil; if ((($a = ((($b = $gvars["!"]['$nil?']()) !== false && $b !== nil) ? $b : $gvars["!"]['$kind_of?']($scope.get('SystemExit')))) !== nil && (!$a.$$is_boolean || $a == true))) { } else { return nil; }; status = self.$run($scope.get('ARGV'), $gvars.stderr, $gvars.stdout).$to_i(); if ((($a = status['$=='](0)['$!']()) !== nil && (!$a.$$is_boolean || $a == true))) { return self.$exit(status) } else { return nil };}, TMP_1.$$s = self, TMP_1), $a).call($b); return self.installed_at_exit = true; }); $opal.cdecl($scope, 'AT_EXIT_HOOK_BACKTRACE_LINE', "" + ("rspec/core/runner") + ":" + ((22)['$-'](2)) + ":in `autorun'"); $opal.defs(self, '$disable_autorun!', function() { var self = this; return self.autorun_disabled = true; }); $opal.defs(self, '$autorun_disabled?', function() { var $a, self = this; if (self.autorun_disabled == null) self.autorun_disabled = nil; return ((($a = self.autorun_disabled) !== false && $a !== nil) ? $a : self.autorun_disabled = false); }); $opal.defs(self, '$installed_at_exit?', function() { var $a, self = this; if (self.installed_at_exit == null) self.installed_at_exit = nil; return ((($a = self.installed_at_exit) !== false && $a !== nil) ? $a : self.installed_at_exit = false); }); $opal.defs(self, '$running_in_drb?', function() { var $a, $b, TMP_2, self = this, local_ipv4 = nil, local_drb = nil; try { try { if ((($a = ($b = ($scope.DRb != null), $b !== false && $b !== nil ?$scope.get('DRb').$current_server() : $b)) !== nil && (!$a.$$is_boolean || $a == true))) { self.$require("socket"); self.$require("uri"); local_ipv4 = $scope.get('IPSocket').$getaddress($scope.get('Socket').$gethostname()); return local_drb = ($a = ($b = ["127.0.0.1", "localhost", local_ipv4])['$any?'], $a.$$p = (TMP_2 = function(addr){var self = TMP_2.$$s || this; if (addr == null) addr = nil; return addr['$=='](self.$URI($scope.get('DRb').$current_server().$uri()).$host())}, TMP_2.$$s = self, TMP_2), $a).call($b); } else { return nil } } catch ($err) {if ($opal.$rescue($err, [(($scope.get('DRb')).$$scope.get('DRbServerNotFound'))])) { return nil }else { throw $err; } } } finally { return ((($a = local_drb) !== false && $a !== nil) ? $a : false) }; }); $opal.defs(self, '$trap_interrupt', function() { var $a, $b, TMP_3, self = this; return ($a = ($b = self).$trap, $a.$$p = (TMP_3 = function(){var self = TMP_3.$$s || this, $a, $b; if ((($a = $scope.get('RSpec').$wants_to_quit()) !== nil && (!$a.$$is_boolean || $a == true))) { self['$exit!'](1)}; (($a = [true]), $b = $scope.get('RSpec'), $b['$wants_to_quit='].apply($b, $a), $a[$a.length-1]); return $scope.get('STDERR').$puts("\nExiting... Interrupt again to exit immediately.");}, TMP_3.$$s = self, TMP_3), $a).call($b, "INT"); }); return ($opal.defs(self, '$run', function(args, err, out) { var $a, self = this, options = nil; if ($gvars.stderr == null) $gvars.stderr = nil; if ($gvars.stdout == null) $gvars.stdout = nil; if (err == null) { err = $gvars.stderr } if (out == null) { out = $gvars.stdout } try { self.$trap_interrupt(); options = $scope.get('ConfigurationOptions').$new(args); options.$parse_options(); if ((($a = options.$options()['$[]']("drb")) !== nil && (!$a.$$is_boolean || $a == true))) { self.$require("rspec/core/drb_command_line"); try { return $scope.get('DRbCommandLine').$new(options).$run(err, out) } catch ($err) {if ($opal.$rescue($err, [(($scope.get('DRb')).$$scope.get('DRbConnError'))])) { err.$puts("No DRb server is running. Running in local process instead ..."); return $scope.get('CommandLine').$new(options).$run(err, out); }else { throw $err; } }; } else { return $scope.get('CommandLine').$new(options).$run(err, out) }; } finally { $scope.get('RSpec').$reset() }; }), nil) && 'run'; })(self, null) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/core/shared_context"] = 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(['$each', '$playback_onto', '$__shared_context_recordings', '$new', '$__send__', '$to_proc', '$block', '$method_name', '$args', '$define_method', '$<<', '$record', '$+', '$instance_methods']); 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, 'SharedContext'); var def = self.$$proto, $scope = self.$$scope, $a, $b, TMP_2; def.$included = function(group) { var $a, $b, TMP_1, self = this; return ($a = ($b = self.$__shared_context_recordings()).$each, $a.$$p = (TMP_1 = function(recording){var self = TMP_1.$$s || this; if (recording == null) recording = nil; return recording.$playback_onto(group)}, TMP_1.$$s = self, TMP_1), $a).call($b); }; def.$__shared_context_recordings = function() { var $a, self = this; if (self.__shared_context_recordings == null) self.__shared_context_recordings = nil; return ((($a = self.__shared_context_recordings) !== false && $a !== nil) ? $a : self.__shared_context_recordings = []); }; $opal.cdecl($scope, 'Recording', ($a = ($b = $scope.get('Struct')).$new, $a.$$p = (TMP_2 = function(){var self = TMP_2.$$s || this; return ($opal.defn(self, '$playback_onto', function(group) { var $a, $b, self = this; return ($a = ($b = group).$__send__, $a.$$p = self.$block().$to_proc(), $a).apply($b, [self.$method_name()].concat(self.$args())); }), nil) && 'playback_onto'}, TMP_2.$$s = self, TMP_2), $a).call($b, "method_name", "args", "block")); $opal.defs(self, '$record', function(methods) { var $a, $b, TMP_3, self = this; return ($a = ($b = methods).$each, $a.$$p = (TMP_3 = function(meth){var self = TMP_3.$$s || this, $a, $b, TMP_4; if (meth == null) meth = nil; return ($a = ($b = self).$define_method, $a.$$p = (TMP_4 = function(args){var self = TMP_4.$$s || this, block; args = $slice.call(arguments, 0); block = TMP_4.$$p || nil, TMP_4.$$p = null; return self.$__shared_context_recordings()['$<<']($scope.get('Recording').$new(meth, args, block))}, TMP_4.$$s = self, TMP_4), $a).call($b, meth)}, TMP_3.$$s = self, TMP_3), $a).call($b); }); self.$record(["describe", "context"]['$+']($scope.get('Hooks').$instance_methods(false))['$+']((($scope.get('MemoizedHelpers')).$$scope.get('ClassMethods')).$instance_methods(false))); ;$opal.donate(self, ["$included", "$__shared_context_recordings"]); })(self) })(self); $opal.cdecl($scope, 'SharedContext', (($scope.get('Core')).$$scope.get('SharedContext'))); })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/core/shared_example_group/collection"] = 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(['$fetch_examples', '$private', '$[]', '$source_for', '$find', '$has_key?', '$reverse']); 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, 'SharedExampleGroup'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Collection(){}; var self = $Collection = $klass($base, $super, 'Collection', $Collection); var def = self.$$proto, $scope = self.$$scope; def.examples = def.sources = nil; def.$initialize = function(sources, examples) { var $a, self = this; return $a = [sources, examples], self.sources = $a[0], self.examples = $a[1]; }; def['$[]'] = function(key) { var self = this; return self.$fetch_examples(key); }; self.$private(); def.$fetch_examples = function(key) { var self = this; return self.examples['$[]'](self.$source_for(key))['$[]'](key); }; return (def.$source_for = function(key) { var $a, $b, TMP_1, self = this; return ($a = ($b = self.sources.$reverse()).$find, $a.$$p = (TMP_1 = function(source){var self = TMP_1.$$s || this; if (self.examples == null) self.examples = nil; if (source == null) source = nil; return self.examples['$[]'](source)['$has_key?'](key)}, TMP_1.$$s = self, TMP_1), $a).call($b); }, nil) && 'source_for'; })(self, null) })(self) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/core/shared_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, $range = $opal.range, $klass = $opal.klass, $hash2 = $opal.hash2; $opal.add_stubs(['$add_group', '$to_proc', '$registry', '$alias_method', '$shared_example_groups_for', '$[]', '$ancestors', '$new', '$ensure_block_has_source_location', '$first_non_rspec_line', '$key?', '$first', '$shift', '$warn_if_key_taken', '$add_shared_example_group', '$empty?', '$send', '$class_eval', '$extend', '$configuration', '$shared_example_groups', '$[]=', '$clear', '$private', '$any?', '$===', '$example_block_for', '$warn_with', '$gsub', '$formatted_location', '$join', '$source_location', '$method_defined?', '$define_method', '$split']); (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, 'SharedExampleGroup'); var def = self.$$proto, $scope = self.$$scope, TMP_1; def.$shared_examples = TMP_1 = function(args) { var $a, $b, self = this, $iter = TMP_1.$$p, block = $iter || nil; args = $slice.call(arguments, 0); TMP_1.$$p = null; return ($a = ($b = $scope.get('SharedExampleGroup').$registry()).$add_group, $a.$$p = block.$to_proc(), $a).apply($b, [self].concat(args)); }; self.$alias_method("shared_context", "shared_examples"); self.$alias_method("share_examples_for", "shared_examples"); self.$alias_method("shared_examples_for", "shared_examples"); def.$shared_example_groups = function() { var $a, self = this; return ($a = $scope.get('SharedExampleGroup').$registry()).$shared_example_groups_for.apply($a, ["main"].concat(self.$ancestors()['$[]']($range(0, -1, false)))); }; (function($base) { var self = $module($base, 'TopLevelDSL'); var def = self.$$proto, $scope = self.$$scope, TMP_2; def.$shared_examples = TMP_2 = function(args) { var $a, $b, self = this, $iter = TMP_2.$$p, block = $iter || nil; args = $slice.call(arguments, 0); TMP_2.$$p = null; return ($a = ($b = $scope.get('SharedExampleGroup').$registry()).$add_group, $a.$$p = block.$to_proc(), $a).apply($b, ["main"].concat(args)); }; self.$alias_method("shared_context", "shared_examples"); self.$alias_method("share_examples_for", "shared_examples"); self.$alias_method("shared_examples_for", "shared_examples"); def.$shared_example_groups = function() { var self = this; return $scope.get('SharedExampleGroup').$registry().$shared_example_groups_for("main"); }; ;$opal.donate(self, ["$shared_examples", "$shared_example_groups"]); })(self); $opal.defs(self, '$registry', function() { var $a, self = this; if (self.registry == null) self.registry = nil; return ((($a = self.registry) !== false && $a !== nil) ? $a : self.registry = $scope.get('Registry').$new()); }); (function($base, $super) { function $Registry(){}; var self = $Registry = $klass($base, $super, 'Registry', $Registry); var def = self.$$proto, $scope = self.$$scope, TMP_3, $a; def.shared_example_groups = nil; def.$add_group = TMP_3 = function(source, args) { var $a, $b, TMP_4, self = this, $iter = TMP_3.$$p, block = $iter || nil, key = nil, mod = nil; args = $slice.call(arguments, 1); TMP_3.$$p = null; self.$ensure_block_has_source_location(block, $scope.get('CallerFilter').$first_non_rspec_line()); if ((($a = self['$key?'](args.$first())) !== nil && (!$a.$$is_boolean || $a == true))) { key = args.$shift(); self.$warn_if_key_taken(source, key, block); self.$add_shared_example_group(source, key, block);}; if ((($a = args['$empty?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return nil } else { mod = $scope.get('Module').$new(); ($a = ($b = ((function(self) { var $scope = self.$$scope, def = self.$$proto; return self })(mod.$singleton_class()))).$send, $a.$$p = (TMP_4 = function(host){var self = TMP_4.$$s || this, $a, $b; if (host == null) host = nil; return ($a = ($b = host).$class_eval, $a.$$p = block.$to_proc(), $a).call($b)}, TMP_4.$$s = self, TMP_4), $a).call($b, "define_method", "extended"); return ($a = $scope.get('RSpec').$configuration()).$extend.apply($a, [mod].concat(args)); }; }; def.$shared_example_groups_for = function(sources) { var self = this; sources = $slice.call(arguments, 0); return $scope.get('Collection').$new(sources, self.$shared_example_groups()); }; def.$shared_example_groups = function() { var $a, $b, $c, TMP_5, self = this; return ((($a = self.shared_example_groups) !== false && $a !== nil) ? $a : self.shared_example_groups = ($b = ($c = $scope.get('Hash')).$new, $b.$$p = (TMP_5 = function(hash, key){var self = TMP_5.$$s || this; if (hash == null) hash = nil;if (key == null) key = nil; return hash['$[]='](key, $scope.get('Hash').$new())}, TMP_5.$$s = self, TMP_5), $b).call($c)); }; def.$clear = function() { var self = this; return self.$shared_example_groups().$clear(); }; self.$private(); def.$add_shared_example_group = function(source, key, block) { var self = this; return self.$shared_example_groups()['$[]'](source)['$[]='](key, block); }; def['$key?'] = function(candidate) { var $a, $b, TMP_6, self = this; return ($a = ($b = [$scope.get('String'), $scope.get('Symbol'), $scope.get('Module')])['$any?'], $a.$$p = (TMP_6 = function(cls){var self = TMP_6.$$s || this; if (cls == null) cls = nil; return cls['$==='](candidate)}, TMP_6.$$s = self, TMP_6), $a).call($b); }; def.$warn_if_key_taken = function(source, key, new_block) { var $a, self = this, existing_block = nil; if ((($a = existing_block = self.$example_block_for(source, key)) !== nil && (!$a.$$is_boolean || $a == true))) { } else { return nil }; return $scope.get('RSpec').$warn_with((((((((" |WARNING: Shared example group '") + (key)) + "' has been previously defined at:\n | ") + (self.$formatted_location(existing_block))) + "\n |...and you are now defining it at:\n | ") + (self.$formatted_location(new_block))) + "\n |The new definition will overwrite the original one.\n").$gsub(/^ +\|/, ""), $hash2(["call_site"], {"call_site": nil})); }; def.$formatted_location = function(block) { var self = this; return block.$source_location().$join(":"); }; def.$example_block_for = function(source, key) { var self = this; return self.$shared_example_groups()['$[]'](source)['$[]'](key); }; if ((($a = $scope.get('Proc')['$method_defined?']("source_location")) !== nil && (!$a.$$is_boolean || $a == true))) { return (def.$ensure_block_has_source_location = function(block, caller_line) { var self = this; return nil; }, nil) && 'ensure_block_has_source_location' } else { return (def.$ensure_block_has_source_location = function(block, caller_line) { var $a, $b, TMP_7, self = this; return block.$extend(($a = ($b = $scope.get('Module')).$new, $a.$$p = (TMP_7 = function(){var self = TMP_7.$$s || this, $a, $b, TMP_8; return ($a = ($b = self).$define_method, $a.$$p = (TMP_8 = function(){var self = TMP_8.$$s || this; return caller_line.$split(":")}, TMP_8.$$s = self, TMP_8), $a).call($b, "source_location")}, TMP_7.$$s = self, TMP_7), $a).call($b)); }, nil) && 'ensure_block_has_source_location' }; })(self, null); ;$opal.donate(self, ["$shared_examples", "$shared_example_groups"]); })(self) })(self) })(self); self.$extend((((((($scope.get('RSpec')).$$scope.get('Core'))).$$scope.get('SharedExampleGroup'))).$$scope.get('TopLevelDSL'))); return $scope.get('Module').$send("include", (((((($scope.get('RSpec')).$$scope.get('Core'))).$$scope.get('SharedExampleGroup'))).$$scope.get('TopLevelDSL'))); }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/core/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, 'Core'); 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) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/core/warnings"] = 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, $hash2 = $opal.hash2; $opal.add_stubs(['$deprecation', '$reporter', '$configuration', '$merge', '$first_non_rspec_line']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; $opal.defs(self, '$deprecate', function(deprecated, data) { var self = this; if (data == null) { data = $hash2([], {}) } return $scope.get('RSpec').$configuration().$reporter().$deprecation($hash2(["deprecated", "call_site"], {"deprecated": deprecated, "call_site": $scope.get('CallerFilter').$first_non_rspec_line()}).$merge(data)); }); $opal.defs(self, '$warn_deprecation', function(message) { var self = this; return $scope.get('RSpec').$configuration().$reporter().$deprecation($hash2(["message"], {"message": message})); }); })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/core/world"] = 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(['$include', '$attr_reader', '$attr_accessor', '$new', '$[]=', '$dup', '$examples', '$prune', '$filter_manager', '$uniq!', '$configuration', '$fetch', '$ordering_registry', '$order', '$clear', '$example_groups', '$registry', '$<<', '$inclusion_filter', '$exclusion_filter', '$configure_group', '$inject', '$+', '$size', '$filtered_examples', '$flat_map', '$descendants', '$<=', '$sort', '$declaration_line_numbers', '$reporter', '$announce_inclusion_filter', '$announce_exclusion_filter', '$empty?', '$==', '$length', '$message', '$[]', '$join', '$run_all_when_everything_filtered?', '$zero?', '$example_count', '$everything_filtered_message', '$description', '$empty_without_conditional_filters?', '$private']); 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 $World(){}; var self = $World = $klass($base, $super, 'World', $World); var def = self.$$proto, $scope = self.$$scope; def.configuration = def.example_groups = def.line_numbers = nil; self.$include((((($scope.get('RSpec')).$$scope.get('Core'))).$$scope.get('Hooks'))); self.$attr_reader("example_groups", "filtered_examples"); self.$attr_accessor("wants_to_quit"); def.$initialize = function(configuration) { var $a, $b, TMP_1, self = this; if (configuration == null) { configuration = $scope.get('RSpec').$configuration() } self.configuration = configuration; self.example_groups = []; return self.filtered_examples = ($a = ($b = $scope.get('Hash')).$new, $a.$$p = (TMP_1 = function(hash, group){var self = TMP_1.$$s || this, examples = nil; if (hash == null) hash = nil;if (group == null) group = nil; return hash['$[]='](group, (function() {examples = group.$examples().$dup(); examples = self.$filter_manager().$prune(examples); examples['$uniq!'](); return examples;})())}, TMP_1.$$s = self, TMP_1), $a).call($b); }; def.$ordered_example_groups = function() { var self = this, ordering_strategy = nil; ordering_strategy = self.configuration.$ordering_registry().$fetch("global"); return ordering_strategy.$order(self.example_groups); }; def.$reset = function() { var self = this; self.$example_groups().$clear(); return $scope.get('SharedExampleGroup').$registry().$clear(); }; def.$filter_manager = function() { var self = this; return self.configuration.$filter_manager(); }; def.$register = function(example_group) { var self = this; self.$example_groups()['$<<'](example_group); return example_group; }; def.$inclusion_filter = function() { var self = this; return self.configuration.$inclusion_filter(); }; def.$exclusion_filter = function() { var self = this; return self.configuration.$exclusion_filter(); }; def.$configure_group = function(group) { var self = this; return self.configuration.$configure_group(group); }; def.$example_count = function() { var $a, $b, TMP_2, $c, $d, TMP_3, self = this; return ($a = ($b = ($c = ($d = $scope.get('FlatMap')).$flat_map, $c.$$p = (TMP_3 = function(g){var self = TMP_3.$$s || this; if (g == null) g = nil; return g.$descendants()}, TMP_3.$$s = self, TMP_3), $c).call($d, self.$example_groups())).$inject, $a.$$p = (TMP_2 = function(sum, g){var self = TMP_2.$$s || this; if (sum == null) sum = nil;if (g == null) g = nil; return sum['$+'](g.$filtered_examples().$size())}, TMP_2.$$s = self, TMP_2), $a).call($b, 0); }; def.$preceding_declaration_line = function(filter_line) { var $a, $b, TMP_4, self = this; return ($a = ($b = self.$declaration_line_numbers().$sort()).$inject, $a.$$p = (TMP_4 = function(highest_prior_declaration_line, line){var self = TMP_4.$$s || this; if (highest_prior_declaration_line == null) highest_prior_declaration_line = nil;if (line == null) line = nil; if (line['$<='](filter_line)) { return line } else { return highest_prior_declaration_line }}, TMP_4.$$s = self, TMP_4), $a).call($b, nil); }; def.$reporter = function() { var self = this; return self.configuration.$reporter(); }; def.$announce_filters = function() { var $a, $b, self = this, filter_announcements = nil, message = nil; filter_announcements = []; self.$announce_inclusion_filter(filter_announcements); self.$announce_exclusion_filter(filter_announcements); if ((($a = self.$filter_manager()['$empty?']()) !== nil && (!$a.$$is_boolean || $a == true))) { } else if (filter_announcements.$length()['$=='](1)) { self.$reporter().$message("Run options: " + (filter_announcements['$[]'](0))) } else { self.$reporter().$message("Run options:\n " + (filter_announcements.$join("\n "))) }; if ((($a = ($b = self.configuration['$run_all_when_everything_filtered?'](), $b !== false && $b !== nil ?self.$example_count()['$zero?']() : $b)) !== nil && (!$a.$$is_boolean || $a == true))) { self.$reporter().$message("" + (self.$everything_filtered_message()) + "; ignoring " + (self.$inclusion_filter().$description())); self.$filtered_examples().$clear(); self.$inclusion_filter().$clear();}; if ((($a = self.$example_count()['$zero?']()) !== nil && (!$a.$$is_boolean || $a == true))) { self.$example_groups().$clear(); if ((($a = self.$filter_manager()['$empty?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return self.$reporter().$message("No examples found.") } else if ((($a = self.$exclusion_filter()['$empty_without_conditional_filters?']()) !== nil && (!$a.$$is_boolean || $a == true))) { message = self.$everything_filtered_message(); if ((($a = self.configuration['$run_all_when_everything_filtered?']()) !== nil && (!$a.$$is_boolean || $a == true))) { message['$<<']("; ignoring " + (self.$inclusion_filter().$description()))}; return self.$reporter().$message(message); } else if ((($a = self.$inclusion_filter()['$empty?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return self.$reporter().$message(self.$everything_filtered_message()) } else { return nil }; } else { return nil }; }; def.$everything_filtered_message = function() { var self = this; return "\nAll examples were filtered out"; }; def.$announce_inclusion_filter = function(announcements) { var $a, self = this; if ((($a = self.$inclusion_filter()['$empty?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return nil } else { return announcements['$<<']("include " + (self.$inclusion_filter().$description())) }; }; def.$announce_exclusion_filter = function(announcements) { var $a, self = this; if ((($a = self.$exclusion_filter()['$empty_without_conditional_filters?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return nil } else { return announcements['$<<']("exclude " + (self.$exclusion_filter().$description())) }; }; self.$private(); return (def.$declaration_line_numbers = function() { var $a, $b, $c, TMP_5, self = this; return ((($a = self.line_numbers) !== false && $a !== nil) ? $a : self.line_numbers = ($b = ($c = self.$example_groups()).$inject, $b.$$p = (TMP_5 = function(lines, g){var self = TMP_5.$$s || this; if (lines == null) lines = nil;if (g == null) g = nil; return lines['$+'](g.$declaration_line_numbers())}, TMP_5.$$s = self, TMP_5), $b).call($c, [])); }, nil) && 'declaration_line_numbers'; })(self, null) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/core"] = function($opal) { $opal.dynamic_require_severity = "warning"; var $a, $b, TMP_1, $c, TMP_2, self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $module = $opal.module, $klass = $opal.klass, $hash2 = $opal.hash2, require_rspec = nil; $opal.add_stubs(['$lambda', '$require_relative', '$require', '$[]', '$autoload', '$wants_to_quit', '$world', '$wants_to_quit=', '$new', '$warn_deprecation', '$first_non_rspec_line', '$configuration', '$clear', '$example_groups', '$current', '$[]=', '$=~', '$define_method', '$to_proc', '$method', '$expand_path', '$fetch', '$const_get']); require_rspec = (function() {if ((($a = ((($b = self.$require_relative) && !$b.rb_stub) || self['$respond_to_missing?']('require_relative') ? 'method' : nil)) !== nil && (!$a.$$is_boolean || $a == true))) { return ($a = ($b = self).$lambda, $a.$$p = (TMP_1 = function(path){var self = TMP_1.$$s || this; if (path == null) path = nil; return self.$require_relative(path)}, TMP_1.$$s = self, TMP_1), $a).call($b) } else { return ($a = ($c = self).$lambda, $a.$$p = (TMP_2 = function(path){var self = TMP_2.$$s || this; if (path == null) path = nil; return self.$require("rspec/" + (path))}, TMP_2.$$s = self, TMP_2), $a).call($c) }; return nil; })(); self.$require("set"); self.$require("time"); self.$require("rbconfig"); require_rspec['$[]']("core/version"); self.$require("rspec/support/caller_filter"); self.$require("rspec/core/warnings"); self.$require("rspec/support/warnings"); require_rspec['$[]']("core/flat_map"); require_rspec['$[]']("core/filter_manager"); require_rspec['$[]']("core/dsl"); require_rspec['$[]']("core/reporter"); require_rspec['$[]']("core/hooks"); require_rspec['$[]']("core/memoized_helpers"); require_rspec['$[]']("core/metadata"); require_rspec['$[]']("core/pending"); require_rspec['$[]']("core/formatters"); require_rspec['$[]']("core/ordering"); require_rspec['$[]']("core/world"); require_rspec['$[]']("core/configuration"); require_rspec['$[]']("core/option_parser"); require_rspec['$[]']("core/configuration_options"); require_rspec['$[]']("core/command_line"); require_rspec['$[]']("core/runner"); require_rspec['$[]']("core/example"); require_rspec['$[]']("core/shared_example_group/collection"); require_rspec['$[]']("core/shared_example_group"); require_rspec['$[]']("core/example_group"); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope, TMP_3, TMP_4, TMP_6; self.$autoload("SharedContext", "rspec/core/shared_context"); $opal.defs(self, '$wants_to_quit', function() { var self = this; return self.$world().$wants_to_quit(); }); $opal.defs(self, '$wants_to_quit=', function(maybe) { var $a, $b, self = this; return (($a = [(maybe)]), $b = self.$world(), $b['$wants_to_quit='].apply($b, $a), $a[$a.length-1]); }); $opal.defs(self, '$world', function() { var $a, self = this; if (self.world == null) self.world = nil; return ((($a = self.world) !== false && $a !== nil) ? $a : self.world = (((($scope.get('RSpec')).$$scope.get('Core'))).$$scope.get('World')).$new()); }); $opal.defs(self, '$world=', function(new_world) { var self = this; return self.world = new_world; }); $opal.defs(self, '$reset', function() { var self = this; self.world = nil; return self.configuration = nil; }); $opal.defs(self, '$configuration', TMP_3 = function() { var $a, self = this, $iter = TMP_3.$$p, $yield = $iter || nil; if (self.configuration == null) self.configuration = nil; TMP_3.$$p = null; if (($yield !== nil)) { $scope.get('RSpec').$warn_deprecation("\n*****************************************************************\nDEPRECATION WARNING\n\n* RSpec.configuration with a block is deprecated and has no effect.\n* please use RSpec.configure with a block instead.\n\nCalled from " + ($scope.get('CallerFilter').$first_non_rspec_line()) + "\n*****************************************************************\n\n")}; return ((($a = self.configuration) !== false && $a !== nil) ? $a : self.configuration = (((($scope.get('RSpec')).$$scope.get('Core'))).$$scope.get('Configuration')).$new()); }); $opal.defs(self, '$configuration=', function(new_configuration) { var self = this; return self.configuration = new_configuration; }); $opal.defs(self, '$configure', TMP_4 = function() { var $a, self = this, $iter = TMP_4.$$p, $yield = $iter || nil; TMP_4.$$p = null; if (($yield !== nil)) { return $a = $opal.$yield1($yield, self.$configuration()), $a === $breaker ? $a : $a } else { return nil }; }); $opal.defs(self, '$clear_remaining_example_groups', function() { var self = this; return self.$world().$example_groups().$clear(); }); $opal.defs(self, '$current_example', function() { var self = this; return $scope.get('Thread').$current()['$[]']("_rspec_current_example"); }); $opal.defs(self, '$current_example=', function(example) { var self = this; return $scope.get('Thread').$current()['$[]=']("_rspec_current_example", example); }); $opal.defs(self, '$windows_os?', function() { var self = this; return (($scope.get('RbConfig')).$$scope.get('CONFIG'))['$[]']("host_os")['$=~'](/cygwin|mswin|mingw|bccwin|wince|emx/); }); (function($base) { var self = $module($base, 'Core'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Time(){}; var self = $Time = $klass($base, $super, 'Time', $Time); var def = self.$$proto, $scope = self.$$scope; return (function(self) { var $scope = self.$$scope, def = self.$$proto; return ($a = ($b = self).$define_method, $a.$$p = Opal.get('Time').$method("now").$to_proc(), $a).call($b, "now") })(self.$singleton_class()) })(self, null); $opal.defs(self, '$path_to_executable', function() { var $a, self = this; if (self.path_to_executable == null) self.path_to_executable = nil; return ((($a = self.path_to_executable) !== false && $a !== nil) ? $a : self.path_to_executable = $scope.get('File').$expand_path("../../../exe/rspec", "rspec/core")); }); })(self); $opal.cdecl($scope, 'MODULES_TO_AUTOLOAD', $hash2(["Matchers", "Expectations", "Mocks"], {"Matchers": "rspec/expectations", "Expectations": "rspec/expectations", "Mocks": "rspec/mocks"})); $opal.defs(self, '$const_missing', TMP_6 = function(name) {try { var $a, $b, TMP_5, self = this, $iter = TMP_6.$$p, $yield = $iter || nil; TMP_6.$$p = null; self.$require(($a = ($b = $scope.get('MODULES_TO_AUTOLOAD')).$fetch, $a.$$p = (TMP_5 = function(){var self = TMP_5.$$s || this; $opal.$return($opal.find_iter_super_dispatcher(self, 'const_missing', (TMP_5.$$def || TMP_6), null).apply(self, $slice.call(arguments)))}, TMP_5.$$s = self, TMP_5), $a).call($b, name)); return Opal.get('RSpec').$const_get(name); } catch ($returner) { if ($returner === $opal.returner) { return $returner.$v } throw $returner; } }); })(self); }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/support/caller_filter"] = 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(['$join', '$+', '$>=', '$!', '$caller', '$raise', '$find', '$=~', '$*']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $CallerFilter(){}; var self = $CallerFilter = $klass($base, $super, 'CallerFilter', $CallerFilter); var def = self.$$proto, $scope = self.$$scope; $opal.cdecl($scope, 'RSPEC_LIBS', ["core", "mocks", "expectations", "support", "matchers", "rails"]); $opal.cdecl($scope, 'ADDITIONAL_TOP_LEVEL_FILES', ["autorun"]); $opal.cdecl($scope, 'LIB_REGEX', (new RegExp("/lib/rspec/(" + ($scope.get('RSPEC_LIBS')['$+']($scope.get('ADDITIONAL_TOP_LEVEL_FILES'))).$join("|") + ")(\\.rb|/)"))); if ($scope.get('RUBY_VERSION')['$>=']("2.0.0")) { return ($opal.defs(self, '$first_non_rspec_line', function() { var $a, $b, $c, TMP_1, self = this, increment = nil, i = nil, line = nil, stack = nil; increment = 5; i = 1; line = nil; while ((($b = line['$!']()) !== nil && (!$b.$$is_boolean || $b == true))) { stack = self.$caller(i, increment); if (stack !== false && stack !== nil) { } else { self.$raise("No non-lib lines in stack") }; line = ($b = ($c = stack).$find, $b.$$p = (TMP_1 = function(l){var self = TMP_1.$$s || this, $a; if (l == null) l = nil; return ($a = l['$=~']($scope.get('LIB_REGEX')), ($a === nil || $a === false))}, TMP_1.$$s = self, TMP_1), $b).call($c); i = i['$+'](increment); increment = increment['$*'](2);}; return line; }), nil) && 'first_non_rspec_line' } else { return ($opal.defs(self, '$first_non_rspec_line', function() { var $a, $b, TMP_2, self = this; return ($a = ($b = self.$caller()).$find, $a.$$p = (TMP_2 = function(line){var self = TMP_2.$$s || this, $a; if (line == null) line = nil; return ($a = line['$=~']($scope.get('LIB_REGEX')), ($a === nil || $a === false))}, TMP_2.$$s = self, TMP_2), $a).call($b); }), nil) && 'first_non_rspec_line' }; })(self, null) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/support/spec/deprecation_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', '$expect', '$[]', '$include', '$join', '$reporter', '$configuration', '$receive', '$allow', '$match', '$to_not']); return (function($base) { var self = $module($base, 'RSpecHelpers'); var def = self.$$proto, $scope = self.$$scope; def.$expect_deprecation_with_call_site = function(file, line) { var $a, $b, TMP_1, self = this; return ($a = ($b = self.$expect($scope.get('RSpec').$configuration().$reporter())).$to, $a.$$p = (TMP_1 = function(options){var self = TMP_1.$$s || this; if (options == null) options = nil; return self.$expect(options['$[]']("call_site")).$to(self.$include([file, line].$join(":")))}, TMP_1.$$s = self, TMP_1), $a).call($b, self.$receive("deprecation")); }; def.$allow_deprecation = function() { var self = this; return self.$allow($scope.get('RSpec').$configuration().$reporter()).$to(self.$receive("deprecation")); }; def.$expect_warning_without_call_site = function(expected) { var $a, $b, TMP_2, self = this; if (expected == null) { expected = /^/ } return ($a = ($b = self.$expect(Opal.get('Kernel'))).$to, $a.$$p = (TMP_2 = function(message){var self = TMP_2.$$s || this; if (message == null) message = nil; self.$expect(message).$to(self.$match(expected)); return self.$expect(message).$to_not(self.$match(/Called from/));}, TMP_2.$$s = self, TMP_2), $a).call($b, self.$receive("warn")); }; def.$expect_warning_with_call_site = function(file, line, expected) { var $a, $b, TMP_3, self = this; if (expected == null) { expected = /^/ } return ($a = ($b = self.$expect(Opal.get('Kernel'))).$to, $a.$$p = (TMP_3 = function(message){var self = TMP_3.$$s || this; if (message == null) message = nil; self.$expect(message).$to(self.$match(expected)); return self.$expect(message).$to(self.$match((new RegExp("Called from " + file + ":" + line))));}, TMP_3.$$s = self, TMP_3), $a).call($b, self.$receive("warn")); }; def.$allow_warning = function() { var self = this; return self.$allow(Opal.get('Kernel')).$to(self.$receive("warn")); }; ;$opal.donate(self, ["$expect_deprecation_with_call_site", "$allow_deprecation", "$expect_warning_without_call_site", "$expect_warning_with_call_site", "$allow_warning"]); })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/support/spec/in_sub_process"] = 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?', '$!', '$==', '$pipe', '$fork', '$write', '$dump', '$close', '$exit!', '$waitpid', '$load', '$read', '$raise', '$pending', '$+']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Support'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'InSubProcess'); var def = self.$$proto, $scope = self.$$scope, $a, $b, $c, TMP_2; if ((($a = ($b = $scope.get('Process')['$respond_to?']("fork"), $b !== false && $b !== nil ?((($c = $scope.get('RUBY_PLATFORM')['$==']("java")) ? $scope.get('RUBY_VERSION')['$==']("1.8.7") : $c))['$!']() : $b)) !== nil && (!$a.$$is_boolean || $a == true))) { def.$in_sub_process = TMP_2 = function() { var $a, $b, TMP_1, self = this, $iter = TMP_2.$$p, $yield = $iter || nil, readme = nil, writeme = nil, pid = nil, exception = nil; TMP_2.$$p = null; $a = $opal.to_ary($scope.get('IO').$pipe()), readme = ($a[0] == null ? nil : $a[0]), writeme = ($a[1] == null ? nil : $a[1]); pid = ($a = ($b = $scope.get('Process')).$fork, $a.$$p = (TMP_1 = function(){var self = TMP_1.$$s || this, exception = nil, e = nil; exception = nil; try { if ($opal.$yieldX($yield, []) === $breaker) return $breaker.$v } catch ($err) {if ($opal.$rescue($err, [$scope.get('Exception')])) {e = $err; exception = e }else { throw $err; } }; writeme.$write($scope.get('Marshal').$dump(exception)); readme.$close(); writeme.$close(); return self['$exit!']();}, TMP_1.$$s = self, TMP_1), $a).call($b); writeme.$close(); $scope.get('Process').$waitpid(pid); exception = $scope.get('Marshal').$load(readme.$read()); readme.$close(); if (exception !== false && exception !== nil) { return self.$raise(exception) } else { return nil }; } } else { def.$in_sub_process = function() { var self = this; return self.$pending("This spec requires forking to work properly, "['$+']("and your platform does not support forking")); } } ;$opal.donate(self, ["$in_sub_process", "$in_sub_process"]); })(self) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/support/spec/stderr_splitter"] = 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', '$new', '$<', '$to_f', '$define_method', '$respond_to?', '$__send__', '$to_proc', '$==', '$write', '$!', '$empty?', '$output', '$has_output?', '$send', '$reset!', '$string']); self.$require("stringio"); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Support'); var def = self.$$proto, $scope = self.$$scope, TMP_2, $a; (function($base, $super) { function $StdErrSplitter(){}; var self = $StdErrSplitter = $klass($base, $super, 'StdErrSplitter', $StdErrSplitter); var def = self.$$proto, $scope = self.$$scope, $a, $b, TMP_1, TMP_3, respond_to_name = nil; def.output_tracker = def.orig_stderr = nil; def.$initialize = function(original) { var self = this; self.orig_stderr = original; return self.output_tracker = Opal.get('StringIO').$new(); }; respond_to_name = (function() {if ((($a = (Opal.get('RUBY_VERSION').$to_f()['$<'](1.9))) !== nil && (!$a.$$is_boolean || $a == true))) { return "respond_to?" } else { return "respond_to_missing?" }; return nil; })(); ($a = ($b = self).$define_method, $a.$$p = (TMP_1 = function(args){var self = TMP_1.$$s || this, $a, $b; if (self.orig_stderr == null) self.orig_stderr = nil; args = $slice.call(arguments, 0); return ((($a = ($b = self.orig_stderr)['$respond_to?'].apply($b, [].concat(args))) !== false && $a !== nil) ? $a : $opal.find_iter_super_dispatcher(self, null, (TMP_1.$$def || null), null).apply(self, $slice.call(arguments)))}, TMP_1.$$s = self, TMP_1), $a).call($b, respond_to_name); def.$method_missing = TMP_3 = function(name, args) { var $a, $b, $c, self = this, $iter = TMP_3.$$p, block = $iter || nil; args = $slice.call(arguments, 1); TMP_3.$$p = null; ($a = ($b = self.output_tracker).$__send__, $a.$$p = block.$to_proc(), $a).apply($b, [name].concat(args)); return ($a = ($c = self.orig_stderr).$__send__, $a.$$p = block.$to_proc(), $a).apply($c, [name].concat(args)); }; def['$=='] = function(other) { var self = this; return self.orig_stderr['$=='](other); }; def.$write = function(args) { var $a, $b, self = this; args = $slice.call(arguments, 0); ($a = self.orig_stderr).$write.apply($a, [].concat(args)); return ($b = self.output_tracker).$write.apply($b, [].concat(args)); }; def['$has_output?'] = function() { var self = this; return self.$output()['$empty?']()['$!'](); }; def['$reset!'] = function() { var self = this; return self.output_tracker = Opal.get('StringIO').$new(); }; def['$verify_example!'] = function(example) { var $a, self = this; if ((($a = self['$has_output?']()) !== nil && (!$a.$$is_boolean || $a == true))) { example.$send("fail", "Warnings were generated: " + (self.$output()))}; return self['$reset!'](); }; return (def.$output = function() { var self = this; return self.output_tracker.$string(); }, nil) && 'output'; })(self, ((function() {if ((($a = ($opal.Object.$$scope.BasicObject == null ? nil : 'constant')) !== nil && (!$a.$$is_boolean || $a == true))) { return Opal.get('BasicObject') } else { return Opal.get('Object') }; return nil; })())) })(self) })(self); }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/support/spec"] = function($opal) { $opal.dynamic_require_severity = "warning"; var $a, $b, TMP_1, self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $gvars = $opal.gvars, warning_preventer = nil; if ($gvars.stderr == null) $gvars.stderr = nil; $opal.add_stubs(['$require', '$new', '$configure', '$include', '$before', '$reset!', '$after', '$verify_example!']); self.$require("rspec/support/spec/deprecation_helpers"); self.$require("rspec/support/spec/stderr_splitter"); warning_preventer = $gvars.stderr = (((($scope.get('RSpec')).$$scope.get('Support'))).$$scope.get('StdErrSplitter')).$new($gvars.stderr); return ($a = ($b = $scope.get('RSpec')).$configure, $a.$$p = (TMP_1 = function(c){var self = TMP_1.$$s || this, $a, $b, TMP_2, $c, TMP_3; if (c == null) c = nil; c.$include($scope.get('RSpecHelpers')); ($a = ($b = c).$before, $a.$$p = (TMP_2 = function(){var self = TMP_2.$$s || this; return warning_preventer['$reset!']()}, TMP_2.$$s = self, TMP_2), $a).call($b); return ($a = ($c = c).$after, $a.$$p = (TMP_3 = function(example){var self = TMP_3.$$s || this; if (example == null) example = nil; return warning_preventer['$verify_example!'](example)}, TMP_3.$$s = self, TMP_3), $a).call($c);}, TMP_1.$$s = self, TMP_1), $a).call($b); }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/support/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, 'Support'); 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) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/support/warnings"] = 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, $hash2 = $opal.hash2; $opal.add_stubs(['$respond_to?', '$warn_with', '$fetch', '$first_non_rspec_line', '$<<', '$warn']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope, $a; if ((($a = self['$respond_to?']("deprecate")) !== nil && (!$a.$$is_boolean || $a == true))) { } else { $opal.defs(self, '$deprecate', function(deprecated, options) { var self = this; if (options == null) { options = $hash2([], {}) } return self.$warn_with("DEPRECATION: " + (deprecated) + " is deprecated.", options); }) }; if ((($a = self['$respond_to?']("warn_deprecation")) !== nil && (!$a.$$is_boolean || $a == true))) { } else { $opal.defs(self, '$warn_deprecation', function(message) { var self = this; return self.$warn_with("DEPRECATION: \n " + (message)); }) }; $opal.defs(self, '$warning', function(text, options) { var self = this; if (options == null) { options = $hash2([], {}) } return self.$warn_with("WARNING: " + (text) + ".", options); }); $opal.defs(self, '$warn_with', function(message, options) { var $a, $b, TMP_1, self = this, call_site = nil; if (options == null) { options = $hash2([], {}) } call_site = ($a = ($b = options).$fetch, $a.$$p = (TMP_1 = function(){var self = TMP_1.$$s || this; return $scope.get('CallerFilter').$first_non_rspec_line()}, TMP_1.$$s = self, TMP_1), $a).call($b, "call_site"); if (call_site !== false && call_site !== nil) { message['$<<'](" Called from " + (call_site) + ".")}; return Opal.get('Kernel').$warn(message); }); })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/support"] = 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(['$require']); self.$require("rspec/support/version"); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Support'); var def = self.$$proto, $scope = self.$$scope; nil })(self) })(self); }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/expectations/differ"] = 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', '$pick_encoding', '$matching_encoding', '$map!', '$chomp', '$split', '$diff', '$empty?', '$each', '$new', '$context_lines', '$file_length_difference', '$>', '$overlaps?', '$respond_to?', '$merge', '$unshift', '$<<', '$to_s', '$format', '$color_diff', '$!', '$==', '$encoding', '$+', '$object_to_string', '$diff_as_string', '$protected', '$color', '$color?', '$configuration', '$join', '$map', '$chr', '$[]', '$===', '$green', '$red', '$blue', '$lines', '$singleline_pp', '$sort_by', '$keys', '$=~', '$inspect', '$pp', '$private', '$method_defined?', '$compatible?', '$default_external', '$encode']); self.$require("diff/lcs"); self.$require("diff/lcs/hunk"); self.$require("pp"); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Expectations'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Differ(){}; var self = $Differ = $klass($base, $super, 'Differ', $Differ); var def = self.$$proto, $scope = self.$$scope, $a; def.$diff_as_string = function(input_data_new, input_data_old) { var $a, $b, TMP_1, $c, TMP_2, $d, TMP_3, self = this, encoding = nil, output = nil, data_old = nil, data_new = nil, diffs = nil, oldhunk = nil, hunk = nil, file_length_difference = nil; try { encoding = self.$pick_encoding(input_data_new, input_data_old); output = self.$matching_encoding("", encoding); data_old = ($a = ($b = input_data_old.$split(self.$matching_encoding("\n", encoding)))['$map!'], $a.$$p = (TMP_1 = function(e){var self = TMP_1.$$s || this; if (e == null) e = nil; return e.$chomp()}, TMP_1.$$s = self, TMP_1), $a).call($b); data_new = ($a = ($c = input_data_new.$split(self.$matching_encoding("\n", encoding)))['$map!'], $a.$$p = (TMP_2 = function(e){var self = TMP_2.$$s || this; if (e == null) e = nil; return e.$chomp()}, TMP_2.$$s = self, TMP_2), $a).call($c); diffs = (($scope.get('Diff')).$$scope.get('LCS')).$diff(data_old, data_new); if ((($a = diffs['$empty?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return output}; oldhunk = hunk = nil; file_length_difference = 0; ($a = ($d = diffs).$each, $a.$$p = (TMP_3 = function(piece){var self = TMP_3.$$s || this, $a, $b; if (piece == null) piece = nil; try { hunk = (((($scope.get('Diff')).$$scope.get('LCS'))).$$scope.get('Hunk')).$new(data_old, data_new, piece, self.$context_lines(), file_length_difference); file_length_difference = hunk.$file_length_difference(); if (oldhunk !== false && oldhunk !== nil) { } else { return nil; }; if ((($a = ($b = (self.$context_lines()['$>'](0)), $b !== false && $b !== nil ?hunk['$overlaps?'](oldhunk) : $b)) !== nil && (!$a.$$is_boolean || $a == true))) { if ((($a = hunk['$respond_to?']("merge")) !== nil && (!$a.$$is_boolean || $a == true))) { return hunk.$merge(oldhunk) } else { return hunk.$unshift(oldhunk) } } else { return output['$<<'](self.$matching_encoding(oldhunk.$diff(self.$format()).$to_s(), encoding)) }; } finally { oldhunk = hunk; output['$<<'](self.$matching_encoding("\n", encoding)); }}, TMP_3.$$s = self, TMP_3), $a).call($d); output['$<<'](self.$matching_encoding(oldhunk.$diff(self.$format()).$to_s(), encoding)); output['$<<'](self.$matching_encoding("\n", encoding)); return self.$color_diff(output); } catch ($err) {if ($opal.$rescue($err, [(($scope.get('Encoding')).$$scope.get('CompatibilityError'))])) { if ((($a = input_data_new.$encoding()['$=='](input_data_old.$encoding())['$!']()) !== nil && (!$a.$$is_boolean || $a == true))) { return ((("Could not produce a diff because the encoding of the actual string (") + (input_data_old.$encoding())) + ") ")['$+']("differs from the encoding of the expected string (" + (input_data_new.$encoding()) + ")") } else { return "Could not produce a diff because of the encoding of the string (" + (input_data_old.$encoding()) + ")" } }else { throw $err; } }; }; def.$diff_as_object = function(actual, expected) { var $a, self = this, actual_as_string = nil, expected_as_string = nil, diff = nil; actual_as_string = self.$object_to_string(actual); expected_as_string = self.$object_to_string(expected); if ((($a = diff = self.$diff_as_string(actual_as_string, expected_as_string)) !== nil && (!$a.$$is_boolean || $a == true))) { return self.$color_diff(diff) } else { return nil }; }; self.$protected(); def.$format = function() { var self = this; return "unified"; }; def.$context_lines = function() { var self = this; return 3; }; def.$color = function(text, color_code) { var self = this; return "\e[" + (color_code) + "m" + (text) + "\e[0m"; }; def.$red = function(text) { var self = this; return self.$color(text, 31); }; def.$green = function(text) { var self = this; return self.$color(text, 32); }; def.$blue = function(text) { var self = this; return self.$color(text, 34); }; def.$color_diff = function(diff) { var $a, $b, TMP_4, self = this; if ((($a = (($scope.get('RSpec')).$$scope.get('Matchers')).$configuration()['$color?']()) !== nil && (!$a.$$is_boolean || $a == true))) { } else { return diff }; return ($a = ($b = diff.$lines()).$map, $a.$$p = (TMP_4 = function(line){var self = TMP_4.$$s || this, $case = nil; if (line == null) line = nil; return (function() {$case = line['$[]'](0).$chr();if ("+"['$===']($case)) {return self.$green(line)}else if ("-"['$===']($case)) {return self.$red(line)}else if ("@"['$===']($case)) {if (line['$[]'](1).$chr()['$==']("@")) { return self.$blue(line) } else { return line }}else {return line}})()}, TMP_4.$$s = self, TMP_4), $a).call($b).$join(); }; def.$object_to_string = function(object) { var $a, $b, TMP_5, $c, $d, TMP_6, self = this, $case = nil; return (function() {$case = object;if ($scope.get('Hash')['$===']($case)) {return ($a = ($b = ($c = ($d = object.$keys()).$sort_by, $c.$$p = (TMP_6 = function(k){var self = TMP_6.$$s || this; if (k == null) k = nil; return k.$to_s()}, TMP_6.$$s = self, TMP_6), $c).call($d)).$map, $a.$$p = (TMP_5 = function(key){var self = TMP_5.$$s || this, pp_key = nil, pp_value = nil, encoding = nil; if (key == null) key = nil; pp_key = $scope.get('PP').$singleline_pp(key, ""); pp_value = $scope.get('PP').$singleline_pp(object['$[]'](key), ""); encoding = self.$pick_encoding(pp_key, pp_value); return self.$matching_encoding("" + (pp_key) + " => " + (pp_value), encoding);}, TMP_5.$$s = self, TMP_5), $a).call($b).$join(",\n")}else if ($scope.get('String')['$===']($case)) {if ((($a = object['$=~'](/\n/)) !== nil && (!$a.$$is_boolean || $a == true))) { return object } else { return object.$inspect() }}else {return $scope.get('PP').$pp(object, "")}})(); }; self.$private(); if ((($a = $scope.get('String')['$method_defined?']("encoding")) !== nil && (!$a.$$is_boolean || $a == true))) { def.$pick_encoding = function(source_a, source_b) { var $a, self = this; return ((($a = $scope.get('Encoding')['$compatible?'](source_a, source_b)) !== false && $a !== nil) ? $a : $scope.get('Encoding').$default_external()); }; return (def.$matching_encoding = function(string, encoding) { var self = this; try { return string.$encode(encoding) } catch ($err) {if ($opal.$rescue($err, [(($scope.get('Encoding')).$$scope.get('UndefinedConversionError'))])) { return string.$encode(encoding, $hash2(["undef"], {"undef": "replace"})) }else { throw $err; } }; }, nil) && 'matching_encoding'; } else { def.$pick_encoding = function(source_a, source_b) { var self = this; return nil; }; return (def.$matching_encoding = function(string, encoding) { var self = this; return string; }, nil) && 'matching_encoding'; }; })(self, null) })(self) })(self); }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/expectations/errors"] = 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([]); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Expectations'); var def = self.$$proto, $scope = self.$$scope, $a; if ((($a = (function(){ try { return (((((($scope.get('Test')).$$scope.get('Unit'))).$$scope.get('AssertionFailedError'))) != null ? 'constant' : nil); } catch (err) { if (err.$$class === Opal.NameError) { return nil; } else { throw(err); }}; })()) !== nil && (!$a.$$is_boolean || $a == true))) { (function($base, $super) { function $ExpectationNotMetError(){}; var self = $ExpectationNotMetError = $klass($base, $super, 'ExpectationNotMetError', $ExpectationNotMetError); var def = self.$$proto, $scope = self.$$scope; return nil; })(self, (((($scope.get('Test')).$$scope.get('Unit'))).$$scope.get('AssertionFailedError'))) } else { (function($base, $super) { function $ExpectationNotMetError(){}; var self = $ExpectationNotMetError = $klass($base, $super, 'ExpectationNotMetError', $ExpectationNotMetError); var def = self.$$proto, $scope = self.$$scope; return nil; })(self, Opal.get('StandardError')) } })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/expectations/expectation_target"] = 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(['$attr_accessor', '$prevent_operator_matchers', '$handle_matcher', '$to_proc', '$deprecated_should_enabled?', '$deprecate', '$should', '$should_not', '$deprecated_should_enabled=', '$remove_method', '$private', '$raise', '$+']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Expectations'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $ExpectationTarget(){}; var self = $ExpectationTarget = $klass($base, $super, 'ExpectationTarget', $ExpectationTarget); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2; def.target = nil; (function(self) { var $scope = self.$$scope, def = self.$$proto; self.$attr_accessor("deprecated_should_enabled"); return self.$$proto['$deprecated_should_enabled?'] = self.$$proto.$deprecated_should_enabled; })(self.$singleton_class()); def.$initialize = function(target) { var self = this; return self.target = target; }; def.$to = TMP_1 = function(matcher, message) { var $a, $b, self = this, $iter = TMP_1.$$p, block = $iter || nil; if (matcher == null) { matcher = nil } if (message == null) { message = nil } TMP_1.$$p = null; self.$prevent_operator_matchers("to", matcher); return ($a = ($b = (((($scope.get('RSpec')).$$scope.get('Expectations'))).$$scope.get('PositiveExpectationHandler'))).$handle_matcher, $a.$$p = block.$to_proc(), $a).call($b, self.target, matcher, message); }; def.$not_to = TMP_2 = function(matcher, message) { var $a, $b, self = this, $iter = TMP_2.$$p, block = $iter || nil; if (matcher == null) { matcher = nil } if (message == null) { message = nil } TMP_2.$$p = null; self.$prevent_operator_matchers("not_to", matcher); return ($a = ($b = (((($scope.get('RSpec')).$$scope.get('Expectations'))).$$scope.get('NegativeExpectationHandler'))).$handle_matcher, $a.$$p = block.$to_proc(), $a).call($b, self.target, matcher, message); }; $opal.defn(self, '$to_not', def.$not_to); $opal.defs(self, '$enable_deprecated_should', function() { var $a, $b, self = this; if ((($a = self['$deprecated_should_enabled?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return nil}; def.$should = function(args) { var $a, self = this; if (self.target == null) self.target = nil; args = $slice.call(arguments, 0); $scope.get('RSpec').$deprecate("`expect { }.should`", $hash2(["replacement"], {"replacement": "`expect { }.to`"})); return ($a = self.target).$should.apply($a, [].concat(args)); }; def.$should_not = function(args) { var $a, self = this; if (self.target == null) self.target = nil; args = $slice.call(arguments, 0); $scope.get('RSpec').$deprecate("`expect { }.should_not`", $hash2(["replacement"], {"replacement": "`expect { }.not_to`"})); return ($a = self.target).$should_not.apply($a, [].concat(args)); }; return (($a = [true]), $b = self, $b['$deprecated_should_enabled='].apply($b, $a), $a[$a.length-1]); }); $opal.defs(self, '$disable_deprecated_should', function() { var $a, $b, self = this; if ((($a = self['$deprecated_should_enabled?']()) !== nil && (!$a.$$is_boolean || $a == true))) { } else { return nil }; self.$remove_method("should"); self.$remove_method("should_not"); return (($a = [false]), $b = self, $b['$deprecated_should_enabled='].apply($b, $a), $a[$a.length-1]); }); self.$private(); return (def.$prevent_operator_matchers = function(verb, matcher) { var self = this; if (matcher !== false && matcher !== nil) { return nil}; return self.$raise($scope.get('ArgumentError'), "The expect syntax does not support operator matchers, "['$+']("so you must pass a matcher to `#" + (verb) + "`.")); }, nil) && 'prevent_operator_matchers'; })(self, null) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/expectations/extensions/object"] = 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, $hash2 = $opal.hash2; $opal.add_stubs(['$===', '$deprecate', '$to_s', '$reject!', '$=~', '$compile', '$backtrace', '$raise', '$extend']); (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Expectations'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'DeprecatedConstants'); var def = self.$$proto, $scope = self.$$scope, TMP_1; def.$const_missing = TMP_1 = function(name) {var $zuper = $slice.call(arguments, 0); var $a, $b, TMP_2, self = this, $iter = TMP_1.$$p, $yield = $iter || nil, $case = nil, e = nil; TMP_1.$$p = null; return (function() {$case = name;if ("Rspec"['$===']($case) || "Spec"['$===']($case)) {$scope.get('RSpec').$deprecate(name.$to_s(), $hash2(["replacement"], {"replacement": "RSpec"})); return $scope.get('RSpec');}else {try { return $opal.find_super_dispatcher(self, 'const_missing', TMP_1, $iter).apply(self, $zuper) } catch ($err) {if ($opal.$rescue($err, [$scope.get('Exception')])) {e = $err; ($a = ($b = e.$backtrace())['$reject!'], $a.$$p = (TMP_2 = function(l){var self = TMP_2.$$s || this; if (l == null) l = nil; return l['$=~']($scope.get('Regexp').$compile("rspec/expectations/extensions/object"))}, TMP_2.$$s = self, TMP_2), $a).call($b); return self.$raise(e); }else { throw $err; } }}})(); } ;$opal.donate(self, ["$const_missing"]); })(self); def['$differ='] = function(ignore) { var self = this; return $scope.get('RSpec').$deprecate("RSpec::Expectations.differ=(differ)"); }; ;$opal.donate(self, ["$differ="]); })(self) })(self); return self.$extend((((($scope.get('RSpec')).$$scope.get('Expectations'))).$$scope.get('DeprecatedConstants'))); }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/expectations/extensions"] = 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']); return self.$require("rspec/expectations/extensions/object") }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/expectations/fail_with"] = 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(['$new', '$!', '$raise', '$+', '$all_strings?', '$any_multiline_strings?', '$<<', '$diff_as_string', '$differ', '$coerce_to_string', '$no_procs?', '$no_numbers?', '$diff_as_object', '$private', '$none?', '$===', '$flatten', '$all?', '$any?', '$multiline?', '$join', '$diffably_stringify', '$map', '$inspect', '$gsub', '$to_s', '$method_defined?', '$include?', '$encode', '$encoding']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Expectations'); var def = self.$$proto, $scope = self.$$scope; (function(self) { var $scope = self.$$scope, def = self.$$proto; self.$$proto.$differ = function() { var $a, self = this; if (self.differ == null) self.differ = nil; return ((($a = self.differ) !== false && $a !== nil) ? $a : self.differ = $scope.get('Differ').$new()); }; self.$$proto.$fail_with = function(message, expected, actual) { var $a, $b, self = this; if (expected == null) { expected = nil } if (actual == null) { actual = nil } if ((($a = message['$!']()) !== nil && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('ArgumentError'), "Failure message is nil. Does your matcher define the "['$+']("appropriate failure_message_for_* method to return a string?"))}; if ((($a = (($b = actual !== false && actual !== nil) ? expected : $b)) !== nil && (!$a.$$is_boolean || $a == true))) { if ((($a = self['$all_strings?'](actual, expected)) !== nil && (!$a.$$is_boolean || $a == true))) { if ((($a = self['$any_multiline_strings?'](actual, expected)) !== nil && (!$a.$$is_boolean || $a == true))) { message['$<<']("\nDiff:")['$<<'](self.$differ().$diff_as_string(self.$coerce_to_string(actual), self.$coerce_to_string(expected)))} } else if ((($a = ($b = self['$no_procs?'](actual, expected), $b !== false && $b !== nil ?self['$no_numbers?'](actual, expected) : $b)) !== nil && (!$a.$$is_boolean || $a == true))) { message['$<<']("\nDiff:")['$<<'](self.$differ().$diff_as_object(actual, expected))}}; return self.$raise((((($scope.get('RSpec')).$$scope.get('Expectations'))).$$scope.get('ExpectationNotMetError')).$new(message)); }; self.$private(); self.$$proto['$no_procs?'] = function(args) { var $a, $b, TMP_1, self = this; args = $slice.call(arguments, 0); return ($a = ($b = args.$flatten())['$none?'], $a.$$p = (TMP_1 = function(a){var self = TMP_1.$$s || this; if (a == null) a = nil; return $scope.get('Proc')['$==='](a)}, TMP_1.$$s = self, TMP_1), $a).call($b); }; self.$$proto['$all_strings?'] = function(args) { var $a, $b, TMP_2, self = this; args = $slice.call(arguments, 0); return ($a = ($b = args.$flatten())['$all?'], $a.$$p = (TMP_2 = function(a){var self = TMP_2.$$s || this; if (a == null) a = nil; return $scope.get('String')['$==='](a)}, TMP_2.$$s = self, TMP_2), $a).call($b); }; self.$$proto['$any_multiline_strings?'] = function(args) { var $a, $b, $c, $d, TMP_3, self = this; args = $slice.call(arguments, 0); return ($a = ($b = self)['$all_strings?'].apply($b, [].concat(args)), $a !== false && $a !== nil ?($c = ($d = args.$flatten())['$any?'], $c.$$p = (TMP_3 = function(a){var self = TMP_3.$$s || this; if (a == null) a = nil; return self['$multiline?'](a)}, TMP_3.$$s = self, TMP_3), $c).call($d) : $a); }; self.$$proto['$no_numbers?'] = function(args) { var $a, $b, TMP_4, self = this; args = $slice.call(arguments, 0); return ($a = ($b = args.$flatten())['$none?'], $a.$$p = (TMP_4 = function(a){var self = TMP_4.$$s || this; if (a == null) a = nil; return $scope.get('Numeric')['$==='](a)}, TMP_4.$$s = self, TMP_4), $a).call($b); }; self.$$proto.$coerce_to_string = function(string_or_array) { var $a, self = this; if ((($a = $scope.get('Array')['$==='](string_or_array)) !== nil && (!$a.$$is_boolean || $a == true))) { } else { return string_or_array }; return self.$diffably_stringify(string_or_array).$join("\n"); }; self.$$proto.$diffably_stringify = function(array) { var $a, $b, TMP_5, self = this; return ($a = ($b = array).$map, $a.$$p = (TMP_5 = function(entry){var self = TMP_5.$$s || this, $a; if (entry == null) entry = nil; if ((($a = $scope.get('Array')['$==='](entry)) !== nil && (!$a.$$is_boolean || $a == true))) { return entry.$inspect() } else { return entry.$to_s().$gsub("\n", "\\n") }}, TMP_5.$$s = self, TMP_5), $a).call($b); }; if ((($a = $scope.get('String')['$method_defined?']("encoding")) !== nil && (!$a.$$is_boolean || $a == true))) { return (self.$$proto['$multiline?'] = function(string) { var self = this; return string['$include?']("\n".$encode(string.$encoding())); }, nil) && 'multiline?' } else { return (self.$$proto['$multiline?'] = function(string) { var self = this; return string['$include?']("\n"); }, nil) && 'multiline?' }; })(self.$singleton_class()) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/expectations/handler"] = 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(['$nil?', '$respond_to?', '$warn', '$join', '$inspect', '$check_message', '$last_should=', '$last_matcher=', '$new', '$matches?', '$to_proc', '$call', '$failure_message_for_should', '$failure_message', '$diffable?', '$fail_with', '$expected', '$actual', '$!', '$does_not_match?', '$failure_message_for_should_not', '$negative_failure_message']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Expectations'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $ExpectationHandler(){}; var self = $ExpectationHandler = $klass($base, $super, 'ExpectationHandler', $ExpectationHandler); var def = self.$$proto, $scope = self.$$scope; return ($opal.defs(self, '$check_message', function(msg) { var $a, $b, $c, self = this; if ((($a = ((($b = ((($c = msg['$nil?']()) !== false && $c !== nil) ? $c : msg['$respond_to?']("to_str"))) !== false && $b !== nil) ? $b : msg['$respond_to?']("call"))) !== nil && (!$a.$$is_boolean || $a == true))) { return nil } else { return Opal.get('Kernel').$warn(["WARNING: ignoring the provided expectation message argument (", msg.$inspect(), ") since it is not a string or a proc."].$join()) }; }), nil) && 'check_message' })(self, null); (function($base, $super) { function $PositiveExpectationHandler(){}; var self = $PositiveExpectationHandler = $klass($base, $super, 'PositiveExpectationHandler', $PositiveExpectationHandler); var def = self.$$proto, $scope = self.$$scope, TMP_1; return ($opal.defs(self, '$handle_matcher', TMP_1 = function(actual, matcher, message) { var $a, $b, $c, self = this, $iter = TMP_1.$$p, block = $iter || nil, match = nil; if (message == null) { message = nil } TMP_1.$$p = null; self.$check_message(message); (($a = ["should"]), $b = ((Opal.get('RSpec')).$$scope.get('Matchers')), $b['$last_should='].apply($b, $a), $a[$a.length-1]); (($a = [matcher]), $b = ((Opal.get('RSpec')).$$scope.get('Matchers')), $b['$last_matcher='].apply($b, $a), $a[$a.length-1]); if ((($a = matcher['$nil?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return ((((((Opal.get('RSpec')).$$scope.get('Matchers'))).$$scope.get('BuiltIn'))).$$scope.get('PositiveOperatorMatcher')).$new(actual)}; match = ($a = ($b = matcher)['$matches?'], $a.$$p = block.$to_proc(), $a).call($b, actual); if (match !== false && match !== nil) { return match}; if ((($a = message['$respond_to?']("call")) !== nil && (!$a.$$is_boolean || $a == true))) { message = message.$call()}; ((($a = message) !== false && $a !== nil) ? $a : message = (function() {if ((($c = matcher['$respond_to?']("failure_message_for_should")) !== nil && (!$c.$$is_boolean || $c == true))) { return matcher.$failure_message_for_should() } else { return matcher.$failure_message() }; return nil; })()); if ((($a = ($c = matcher['$respond_to?']("diffable?"), $c !== false && $c !== nil ?matcher['$diffable?']() : $c)) !== nil && (!$a.$$is_boolean || $a == true))) { return ((Opal.get('RSpec')).$$scope.get('Expectations')).$fail_with(message, matcher.$expected(), matcher.$actual()) } else { return ((Opal.get('RSpec')).$$scope.get('Expectations')).$fail_with(message) }; }), nil) && 'handle_matcher' })(self, $scope.get('ExpectationHandler')); (function($base, $super) { function $NegativeExpectationHandler(){}; var self = $NegativeExpectationHandler = $klass($base, $super, 'NegativeExpectationHandler', $NegativeExpectationHandler); var def = self.$$proto, $scope = self.$$scope, TMP_2; return ($opal.defs(self, '$handle_matcher', TMP_2 = function(actual, matcher, message) { var $a, $b, $c, $d, self = this, $iter = TMP_2.$$p, block = $iter || nil, match = nil; if (message == null) { message = nil } TMP_2.$$p = null; self.$check_message(message); (($a = ["should_not"]), $b = ((Opal.get('RSpec')).$$scope.get('Matchers')), $b['$last_should='].apply($b, $a), $a[$a.length-1]); (($a = [matcher]), $b = ((Opal.get('RSpec')).$$scope.get('Matchers')), $b['$last_matcher='].apply($b, $a), $a[$a.length-1]); if ((($a = matcher['$nil?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return ((((((Opal.get('RSpec')).$$scope.get('Matchers'))).$$scope.get('BuiltIn'))).$$scope.get('NegativeOperatorMatcher')).$new(actual)}; match = (function() {if ((($a = matcher['$respond_to?']("does_not_match?")) !== nil && (!$a.$$is_boolean || $a == true))) { return ($a = ($b = matcher)['$does_not_match?'], $a.$$p = block.$to_proc(), $a).call($b, actual)['$!']() } else { return ($a = ($c = matcher)['$matches?'], $a.$$p = block.$to_proc(), $a).call($c, actual) }; return nil; })(); if (match !== false && match !== nil) { } else { return match }; if ((($a = message['$respond_to?']("call")) !== nil && (!$a.$$is_boolean || $a == true))) { message = message.$call()}; ((($a = message) !== false && $a !== nil) ? $a : message = (function() {if ((($d = matcher['$respond_to?']("failure_message_for_should_not")) !== nil && (!$d.$$is_boolean || $d == true))) { return matcher.$failure_message_for_should_not() } else { return matcher.$negative_failure_message() }; return nil; })()); if ((($a = ($d = matcher['$respond_to?']("diffable?"), $d !== false && $d !== nil ?matcher['$diffable?']() : $d)) !== nil && (!$a.$$is_boolean || $a == true))) { return ((Opal.get('RSpec')).$$scope.get('Expectations')).$fail_with(message, matcher.$expected(), matcher.$actual()) } else { return ((Opal.get('RSpec')).$$scope.get('Expectations')).$fail_with(message) }; }), nil) && 'handle_matcher' })(self, $scope.get('ExpectationHandler')); })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/expectations/syntax"] = 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, $hash2 = $opal.hash2; $opal.add_stubs(['$extend', '$last', '$ancestors', '$deprecate', '$should_enabled?', '$module_exec', '$warn_about_should_unless_configured', '$handle_matcher', '$to_proc', '$expect_enabled?', '$enable_deprecated_should', '$default_should_host', '$disable_deprecated_should', '$<<', '$==', '$size', '$raise', '$new', '$first', '$method_defined?', '$positive_expression', '$expression_generator', '$negative_expression']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Expectations'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Syntax'); var def = self.$$proto, $scope = self.$$scope; self.$extend(self); def.$default_should_host = function() { var $a, self = this; if (self.default_should_host == null) self.default_should_host = nil; return ((($a = self.default_should_host) !== false && $a !== nil) ? $a : self.default_should_host = Opal.get('Object').$ancestors().$last()); }; $opal.defs(self, '$warn_about_should!', function() { var self = this; return self.warn_about_should = true; }); $opal.defs(self, '$warn_about_should_unless_configured', function(method_name) { var $a, self = this; if (self.warn_about_should == null) self.warn_about_should = nil; if ((($a = self.warn_about_should) !== nil && (!$a.$$is_boolean || $a == true))) { $scope.get('RSpec').$deprecate("Using `" + (method_name) + "` from rspec-expectations' old `:should` syntax without explicitly enabling the syntax", $hash2(["replacement"], {"replacement": "the new `:expect` syntax or explicitly enable `:should`"})); return self.warn_about_should = false; } else { return nil }; }); def.$enable_should = function(syntax_host) { var $a, $b, TMP_1, self = this; if (syntax_host == null) { syntax_host = self.$default_should_host() } self.warn_about_should = false; if ((($a = self['$should_enabled?'](syntax_host)) !== nil && (!$a.$$is_boolean || $a == true))) { return nil}; ($a = ($b = syntax_host).$module_exec, $a.$$p = (TMP_1 = function(){var self = TMP_1.$$s || this, TMP_2, TMP_3; $opal.defn(self, '$should', TMP_2 = function(matcher, message) { var $a, $b, self = this, $iter = TMP_2.$$p, block = $iter || nil; if (matcher == null) { matcher = nil } if (message == null) { message = nil } TMP_2.$$p = null; ((((Opal.get('RSpec')).$$scope.get('Expectations'))).$$scope.get('Syntax')).$warn_about_should_unless_configured("should"); return ($a = ($b = ((((Opal.get('RSpec')).$$scope.get('Expectations'))).$$scope.get('PositiveExpectationHandler'))).$handle_matcher, $a.$$p = block.$to_proc(), $a).call($b, self, matcher, message); }); return ($opal.defn(self, '$should_not', TMP_3 = function(matcher, message) { var $a, $b, self = this, $iter = TMP_3.$$p, block = $iter || nil; if (matcher == null) { matcher = nil } if (message == null) { message = nil } TMP_3.$$p = null; ((((Opal.get('RSpec')).$$scope.get('Expectations'))).$$scope.get('Syntax')).$warn_about_should_unless_configured("should_not"); return ($a = ($b = ((((Opal.get('RSpec')).$$scope.get('Expectations'))).$$scope.get('NegativeExpectationHandler'))).$handle_matcher, $a.$$p = block.$to_proc(), $a).call($b, self, matcher, message); }), nil) && 'should_not';}, TMP_1.$$s = self, TMP_1), $a).call($b); if ((($a = self['$expect_enabled?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return ((((Opal.get('RSpec')).$$scope.get('Expectations'))).$$scope.get('ExpectationTarget')).$enable_deprecated_should() } else { return nil }; }; def.$disable_should = function(syntax_host) { var $a, $b, TMP_4, self = this; if (syntax_host == null) { syntax_host = self.$default_should_host() } if ((($a = self['$should_enabled?'](syntax_host)) !== nil && (!$a.$$is_boolean || $a == true))) { } else { return nil }; ($a = ($b = syntax_host).$module_exec, $a.$$p = (TMP_4 = function(){var self = TMP_4.$$s || this; delete def.$should; return delete def.$should_not;}, TMP_4.$$s = self, TMP_4), $a).call($b); return ((((Opal.get('RSpec')).$$scope.get('Expectations'))).$$scope.get('ExpectationTarget')).$disable_deprecated_should(); }; def.$enable_expect = function(syntax_host) { var $a, $b, TMP_5, self = this; if (syntax_host == null) { syntax_host = ((Opal.get('RSpec')).$$scope.get('Matchers')) } if ((($a = self['$expect_enabled?'](syntax_host)) !== nil && (!$a.$$is_boolean || $a == true))) { return nil}; ($a = ($b = syntax_host).$module_exec, $a.$$p = (TMP_5 = function(){var self = TMP_5.$$s || this, TMP_6; return ($opal.defn(self, '$expect', TMP_6 = function(target) { var self = this, $iter = TMP_6.$$p, target_block = $iter || nil; target = $slice.call(arguments, 0); TMP_6.$$p = null; if ((target_block !== nil)) { target['$<<'](target_block)}; if (target.$size()['$=='](1)) { } else { self.$raise($scope.get('ArgumentError').$new("You must pass an argument or a block to #expect but not both.")) }; return ((((Opal.get('RSpec')).$$scope.get('Expectations'))).$$scope.get('ExpectationTarget')).$new(target.$first()); }), nil) && 'expect'}, TMP_5.$$s = self, TMP_5), $a).call($b); if ((($a = self['$should_enabled?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return ((((Opal.get('RSpec')).$$scope.get('Expectations'))).$$scope.get('ExpectationTarget')).$enable_deprecated_should() } else { return nil }; }; def.$disable_expect = function(syntax_host) { var $a, $b, TMP_7, self = this; if (syntax_host == null) { syntax_host = ((Opal.get('RSpec')).$$scope.get('Matchers')) } if ((($a = self['$expect_enabled?'](syntax_host)) !== nil && (!$a.$$is_boolean || $a == true))) { } else { return nil }; ($a = ($b = syntax_host).$module_exec, $a.$$p = (TMP_7 = function(){var self = TMP_7.$$s || this; return delete def.$expect}, TMP_7.$$s = self, TMP_7), $a).call($b); return ((((Opal.get('RSpec')).$$scope.get('Expectations'))).$$scope.get('ExpectationTarget')).$disable_deprecated_should(); }; def['$should_enabled?'] = function(syntax_host) { var self = this; if (syntax_host == null) { syntax_host = self.$default_should_host() } return syntax_host['$method_defined?']("should"); }; def['$expect_enabled?'] = function(syntax_host) { var self = this; if (syntax_host == null) { syntax_host = ((Opal.get('RSpec')).$$scope.get('Matchers')) } return syntax_host['$method_defined?']("expect"); }; def.$positive_expression = function(target_expression, matcher_expression) { var self = this; return self.$expression_generator().$positive_expression(target_expression, matcher_expression); }; def.$negative_expression = function(target_expression, matcher_expression) { var self = this; return self.$expression_generator().$negative_expression(target_expression, matcher_expression); }; def.$expression_generator = function() { var $a, self = this; if ((($a = self['$expect_enabled?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return $scope.get('ExpectExpressionGenerator') } else { return $scope.get('ShouldExpressionGenerator') }; }; (function($base) { var self = $module($base, 'ShouldExpressionGenerator'); var def = self.$$proto, $scope = self.$$scope; $opal.defs(self, '$positive_expression', function(target_expression, matcher_expression) { var self = this; return "" + (target_expression) + ".should " + (matcher_expression); }); $opal.defs(self, '$negative_expression', function(target_expression, matcher_expression) { var self = this; return "" + (target_expression) + ".should_not " + (matcher_expression); }); })(self); (function($base) { var self = $module($base, 'ExpectExpressionGenerator'); var def = self.$$proto, $scope = self.$$scope; $opal.defs(self, '$positive_expression', function(target_expression, matcher_expression) { var self = this; return "expect(" + (target_expression) + ").to " + (matcher_expression); }); $opal.defs(self, '$negative_expression', function(target_expression, matcher_expression) { var self = this; return "expect(" + (target_expression) + ").not_to " + (matcher_expression); }); })(self); ;$opal.donate(self, ["$default_should_host", "$enable_should", "$disable_should", "$enable_expect", "$disable_expect", "$should_enabled?", "$expect_enabled?", "$positive_expression", "$negative_expression", "$expression_generator"]); })(self) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/expectations/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, 'Expectations'); 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) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/expectations"] = 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(['$require', '$instance_method', '$>=', '$to_i', '$call', '$bind', '$===', '$method']); self.$require("rspec/support/caller_filter"); self.$require("rspec/support/warnings"); self.$require("rspec/expectations/extensions"); self.$require("rspec/matchers"); self.$require("rspec/expectations/expectation_target"); self.$require("rspec/matchers/configuration"); self.$require("rspec/expectations/fail_with"); self.$require("rspec/expectations/errors"); self.$require("rspec/expectations/handler"); self.$require("rspec/expectations/version"); self.$require("rspec/expectations/differ"); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Expectations'); var def = self.$$proto, $scope = self.$$scope; $opal.cdecl($scope, 'KERNEL_METHOD_METHOD', Opal.get('Kernel').$instance_method("method")); if ($scope.get('RUBY_VERSION').$to_i()['$>='](2)) { $opal.defs(self, '$method_handle_for', function(object, method_name) { var self = this; return $scope.get('KERNEL_METHOD_METHOD').$bind(object).$call(method_name); }) } else { $opal.defs(self, '$method_handle_for', function(object, method_name) { var $a, self = this; if ((($a = Opal.get('Kernel')['$==='](object)) !== nil && (!$a.$$is_boolean || $a == true))) { return $scope.get('KERNEL_METHOD_METHOD').$bind(object).$call(method_name) } else { return object.$method(method_name) }; }) }; })(self) })(self); }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/matchers/built_in/base_matcher"] = 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(['$include', '$attr_reader', '$match', '$expected', '$empty?', '$unshift', '$assert_ivars', '$inspect', '$name_to_sentence', '$expected_to_sentence', '$matches?', '$private', '$all?', '$include?', '$map', '$to_proc', '$instance_variables', '$raise', '$name', '$class', '$to_sentence']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Matchers'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'BuiltIn'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $BaseMatcher(){}; var self = $BaseMatcher = $klass($base, $super, 'BaseMatcher', $BaseMatcher); var def = self.$$proto, $scope = self.$$scope, TMP_1; def.actual = def.expected = nil; self.$include((((($scope.get('RSpec')).$$scope.get('Matchers'))).$$scope.get('Pretty'))); self.$attr_reader("actual", "expected", "rescued_exception"); def.$initialize = function(expected) { var self = this; if (expected == null) { expected = nil } return self.expected = expected; }; def['$matches?'] = function(actual) { var self = this; self.actual = actual; return self.$match(self.$expected(), actual); }; def.$match_unless_raises = TMP_1 = function(exceptions) { var $a, self = this, $iter = TMP_1.$$p, $yield = $iter || nil; exceptions = $slice.call(arguments, 0); TMP_1.$$p = null; if ((($a = exceptions['$empty?']()) !== nil && (!$a.$$is_boolean || $a == true))) { exceptions.$unshift($scope.get('Exception'))}; try { if ($opal.$yieldX($yield, []) === $breaker) return $breaker.$v; return true; } catch ($err) {if ($opal.$rescue($err, [exceptions])) {self.rescued_exception = $err; return false }else { throw $err; } }; }; def.$failure_message_for_should = function() { var self = this; self.$assert_ivars("@actual", "@expected"); return "expected " + (self.actual.$inspect()) + " to " + (self.$name_to_sentence()) + (self.$expected_to_sentence()); }; def.$failure_message_for_should_not = function() { var self = this; self.$assert_ivars("@actual", "@expected"); return "expected " + (self.actual.$inspect()) + " not to " + (self.$name_to_sentence()) + (self.$expected_to_sentence()); }; def.$description = function() { var $a, self = this; if ((($a = self.$expected()) !== nil && (!$a.$$is_boolean || $a == true))) { return "" + (self.$name_to_sentence()) + " " + (self.expected.$inspect()) } else { return self.$name_to_sentence() }; }; def['$diffable?'] = function() { var self = this; return false; }; def['$=='] = function(other) { var self = this; return self['$matches?'](other); }; self.$private(); return (def.$assert_ivars = function(ivars) { var $a, $b, $c, TMP_2, self = this; ivars = $slice.call(arguments, 0); if ((($a = ($b = ($c = ivars)['$all?'], $b.$$p = (TMP_2 = function(v){var self = TMP_2.$$s || this, $a, $b; if (v == null) v = nil; return ($a = ($b = self.$instance_variables()).$map, $a.$$p = "intern".$to_proc(), $a).call($b)['$include?'](v)}, TMP_2.$$s = self, TMP_2), $b).call($c)) !== nil && (!$a.$$is_boolean || $a == true))) { return nil } else { return self.$raise("" + (self.$class().$name()) + " needs to supply " + (self.$to_sentence(ivars))) }; }, nil) && 'assert_ivars'; })(self, null) })(self) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/matchers/built_in/be"] = 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', '$!', '$inspect', '$actual', '$nil?', '$private', '$empty?', '$parenthesize', '$join', '$inspected_args', '$collect', '$split_words', '$to_sentence', '$include', '$each', '$define_method', '$new', '$__send__', '$gsub', '$to_s', '$negative_expectation_expression', '$raise', '$<<', '$include?', '$expected_to_sentence', '$args_to_sentence', '$negative_expression', '$parse_expected', '$shift', '$is_private_on?', '$predicate', '$to_proc', '$present_tense_predicate', '$args_to_s', '$prefix_to_sentence', '$is_a?', '$first', '$methods', '$private_methods', '$to_sym', '$prefix_and_expected', '$=~']); self.$require("rspec/matchers/dsl"); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Matchers'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'BuiltIn'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $BeTruthy(){}; var self = $BeTruthy = $klass($base, $super, 'BeTruthy', $BeTruthy); var def = self.$$proto, $scope = self.$$scope; def.$match = function(_, actual) { var self = this; return actual['$!']()['$!'](); }; def.$failure_message_for_should = function() { var self = this; return "expected: truthy value\n got: " + (self.$actual().$inspect()); }; return (def.$failure_message_for_should_not = function() { var self = this; return "expected: falsey value\n got: " + (self.$actual().$inspect()); }, nil) && 'failure_message_for_should_not'; })(self, $scope.get('BaseMatcher')); (function($base, $super) { function $BeFalsey(){}; var self = $BeFalsey = $klass($base, $super, 'BeFalsey', $BeFalsey); var def = self.$$proto, $scope = self.$$scope; def.$match = function(_, actual) { var self = this; return actual['$!'](); }; def.$failure_message_for_should = function() { var self = this; return "expected: falsey value\n got: " + (self.$actual().$inspect()); }; return (def.$failure_message_for_should_not = function() { var self = this; return "expected: truthy value\n got: " + (self.$actual().$inspect()); }, nil) && 'failure_message_for_should_not'; })(self, $scope.get('BaseMatcher')); (function($base, $super) { function $BeNil(){}; var self = $BeNil = $klass($base, $super, 'BeNil', $BeNil); var def = self.$$proto, $scope = self.$$scope; def.$match = function(_, actual) { var self = this; return actual['$nil?'](); }; def.$failure_message_for_should = function() { var self = this; return "expected: nil\n got: " + (self.$actual().$inspect()); }; return (def.$failure_message_for_should_not = function() { var self = this; return "expected: not nil\n got: nil"; }, nil) && 'failure_message_for_should_not'; })(self, $scope.get('BaseMatcher')); (function($base) { var self = $module($base, 'BeHelpers'); var def = self.$$proto, $scope = self.$$scope; self.$private(); def.$args_to_s = function() { var $a, self = this; if (self.args == null) self.args = nil; if ((($a = self.args['$empty?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return "" } else { return self.$parenthesize(self.$inspected_args().$join(", ")) }; }; def.$parenthesize = function(string) { var self = this; return "(" + (string) + ")"; }; def.$inspected_args = function() { var $a, $b, TMP_1, self = this; if (self.args == null) self.args = nil; return ($a = ($b = self.args).$collect, $a.$$p = (TMP_1 = function(a){var self = TMP_1.$$s || this; if (a == null) a = nil; return a.$inspect()}, TMP_1.$$s = self, TMP_1), $a).call($b); }; def.$expected_to_sentence = function() { var self = this; if (self.expected == null) self.expected = nil; return self.$split_words(self.expected); }; def.$args_to_sentence = function() { var self = this; if (self.args == null) self.args = nil; return self.$to_sentence(self.args); }; ;$opal.donate(self, ["$args_to_s", "$parenthesize", "$inspected_args", "$expected_to_sentence", "$args_to_sentence"]); })(self); (function($base, $super) { function $Be(){}; var self = $Be = $klass($base, $super, 'Be', $Be); var def = self.$$proto, $scope = self.$$scope, TMP_2, $a, $b, TMP_3; def.actual = nil; self.$include($scope.get('BeHelpers')); def.$initialize = TMP_2 = function(args) { var self = this, $iter = TMP_2.$$p, block = $iter || nil; args = $slice.call(arguments, 0); TMP_2.$$p = null; return self.args = args; }; def.$match = function(_, actual) { var self = this; return actual['$!']()['$!'](); }; def.$failure_message_for_should = function() { var self = this; return "expected " + (self.actual.$inspect()) + " to evaluate to true"; }; def.$failure_message_for_should_not = function() { var self = this; return "expected " + (self.actual.$inspect()) + " to evaluate to false"; }; return ($a = ($b = ["==", "<", "<=", ">=", ">", "===", "=~"]).$each, $a.$$p = (TMP_3 = function(operator){var self = TMP_3.$$s || this, $a, $b, TMP_4; if (operator == null) operator = nil; return ($a = ($b = self).$define_method, $a.$$p = (TMP_4 = function(operand){var self = TMP_4.$$s || this; if (operand == null) operand = nil; return $scope.get('BeComparedTo').$new(operand, operator)}, TMP_4.$$s = self, TMP_4), $a).call($b, operator)}, TMP_3.$$s = self, TMP_3), $a).call($b); })(self, $scope.get('BaseMatcher')); (function($base, $super) { function $BeComparedTo(){}; var self = $BeComparedTo = $klass($base, $super, 'BeComparedTo', $BeComparedTo); var def = self.$$proto, $scope = self.$$scope; def.actual = def.operator = def.expected = nil; def.$initialize = function(operand, operator) { var $a, self = this; $a = [operand, operator], self.expected = $a[0], self.operator = $a[1]; return self.args = []; }; def['$matches?'] = function(actual) { var self = this; self.actual = actual; return self.actual.$__send__(self.operator, self.expected); }; def.$failure_message_for_should = function() { var self = this; return "expected: " + (self.operator) + " " + (self.expected.$inspect()) + "\n got: " + (self.operator.$to_s().$gsub(/./, " ")) + " " + (self.actual.$inspect()); }; def.$failure_message_for_should_not = function() { var $a, self = this, message = nil; message = "`" + (self.$negative_expectation_expression()) + "` not only FAILED,\nit is a bit confusing.\n"; return self.$raise(message['$<<'](((function() {if ((($a = ["===", "=="]['$include?'](self.operator)) !== nil && (!$a.$$is_boolean || $a == true))) { return "It might be more clearly expressed without the \"be\"?" } else { return "It might be more clearly expressed in the positive?" }; return nil; })()))); }; def.$description = function() { var self = this; return "be " + (self.operator) + " " + (self.$expected_to_sentence()) + (self.$args_to_sentence()); }; return (def.$negative_expectation_expression = function() { var self = this; return (($scope.get('Expectations')).$$scope.get('Syntax')).$negative_expression("actual", "be " + (self.operator) + " " + (self.expected)); }, nil) && 'negative_expectation_expression'; })(self, $scope.get('Be')); (function($base, $super) { function $BePredicate(){}; var self = $BePredicate = $klass($base, $super, 'BePredicate', $BePredicate); var def = self.$$proto, $scope = self.$$scope, TMP_5, $a; def.actual = def.block = def.args = def.result = def.expected = def.prefix = nil; self.$include($scope.get('BeHelpers')); def.$initialize = TMP_5 = function(args) { var self = this, $iter = TMP_5.$$p, block = $iter || nil; args = $slice.call(arguments, 0); TMP_5.$$p = null; self.expected = self.$parse_expected(args.$shift()); self.args = args; return self.block = block; }; def['$matches?'] = function(actual) { var $a, $b, $c, self = this, predicate_missing_error = nil; self.actual = actual; if ((($a = self['$is_private_on?'](self.actual)) !== nil && (!$a.$$is_boolean || $a == true))) { self.$raise((($scope.get('Expectations')).$$scope.get('ExpectationNotMetError')).$new("expectation set on private method `" + (self.$predicate()) + "`"))}; try { return self.result = ($a = ($b = actual).$__send__, $a.$$p = self.block.$to_proc(), $a).apply($b, [self.$predicate()].concat(self.args)) } catch ($err) {if ($opal.$rescue($err, [$scope.get('NameError')])) {predicate_missing_error = $err; "this needs to be here or rcov will not count this branch even though it's executed in a code example" }else { throw $err; } }; try { return self.result = ($a = ($c = actual).$__send__, $a.$$p = self.block.$to_proc(), $a).apply($c, [self.$present_tense_predicate()].concat(self.args)) } catch ($err) {if ($opal.$rescue($err, [$scope.get('NameError')])) { return self.$raise(predicate_missing_error) }else { throw $err; } }; }; $opal.defn(self, '$===', def['$matches?']); def.$failure_message_for_should = function() { var self = this; return "expected " + (self.$predicate()) + (self.$args_to_s()) + " to return true, got " + (self.result.$inspect()); }; def.$failure_message_for_should_not = function() { var self = this; return "expected " + (self.$predicate()) + (self.$args_to_s()) + " to return false, got " + (self.result.$inspect()); }; def.$description = function() { var self = this; return "" + (self.$prefix_to_sentence()) + (self.$expected_to_sentence()) + (self.$args_to_sentence()); }; self.$private(); if ((($a = self.$methods().$first()['$is_a?']($scope.get('String'))) !== nil && (!$a.$$is_boolean || $a == true))) { def['$is_private_on?'] = function(actual) { var self = this; return actual.$private_methods()['$include?'](self.$predicate().$to_s()); } } else { def['$is_private_on?'] = function(actual) { var self = this; return actual.$private_methods()['$include?'](self.$predicate()); } }; def.$predicate = function() { var self = this; return ((("") + (self.expected)) + "?").$to_sym(); }; def.$present_tense_predicate = function() { var self = this; return ((("") + (self.expected)) + "s?").$to_sym(); }; def.$parse_expected = function(expected) { var $a, self = this; $a = $opal.to_ary(self.$prefix_and_expected(expected)), self.prefix = ($a[0] == null ? nil : $a[0]), expected = ($a[1] == null ? nil : $a[1]); return expected; }; def.$prefix_and_expected = function(symbol) { var self = this; symbol.$to_s()['$=~'](/^(be_(an?_)?)(.*)/); return [nil, nil]; }; return (def.$prefix_to_sentence = function() { var self = this; return self.$split_words(self.prefix); }, nil) && 'prefix_to_sentence'; })(self, $scope.get('BaseMatcher')); })(self) })(self) })(self); }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/matchers/built_in/be_instance_of"] = 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(['$instance_of?', '$expected']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Matchers'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'BuiltIn'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $BeAnInstanceOf(){}; var self = $BeAnInstanceOf = $klass($base, $super, 'BeAnInstanceOf', $BeAnInstanceOf); var def = self.$$proto, $scope = self.$$scope; def.$match = function(expected, actual) { var self = this; return actual['$instance_of?'](expected); }; return (def.$description = function() { var self = this; return "be an instance of " + (self.$expected()); }, nil) && 'description'; })(self, $scope.get('BaseMatcher')) })(self) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/matchers/built_in/be_kind_of"] = 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(['$kind_of?']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Matchers'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'BuiltIn'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $BeAKindOf(){}; var self = $BeAKindOf = $klass($base, $super, 'BeAKindOf', $BeAKindOf); var def = self.$$proto, $scope = self.$$scope; return (def.$match = function(expected, actual) { var self = this; return actual['$kind_of?'](expected); }, nil) && 'match' })(self, $scope.get('BaseMatcher')) })(self) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/matchers/built_in/be_within"] = 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(['$raise', '$needs_expected', '$respond_to?', '$needs_subtractable', '$<=', '$abs', '$-', '$/', '$*', '$description', '$private', '$new', '$inspect']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Matchers'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'BuiltIn'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $BeWithin(){}; var self = $BeWithin = $klass($base, $super, 'BeWithin', $BeWithin); var def = self.$$proto, $scope = self.$$scope; def.actual = def.expected = def.tolerance = def.delta = def.unit = nil; def.$initialize = function(delta) { var self = this; return self.delta = delta; }; def['$matches?'] = function(actual) { var $a, $b, self = this; self.actual = actual; if ((($a = (($b = self['expected'], $b != null && $b !== nil) ? 'instance-variable' : nil)) !== nil && (!$a.$$is_boolean || $a == true))) { } else { self.$raise(self.$needs_expected()) }; if ((($a = self.actual['$respond_to?']("-")) !== nil && (!$a.$$is_boolean || $a == true))) { } else { self.$raise(self.$needs_subtractable()) }; return (self.actual['$-'](self.expected)).$abs()['$<='](self.tolerance); }; $opal.defn(self, '$==', def['$matches?']); def.$of = function(expected) { var self = this; self.expected = expected; self.tolerance = self.delta; self.unit = ""; return self; }; def.$percent_of = function(expected) { var self = this; self.expected = expected; self.tolerance = self.delta['$*'](self.expected.$abs())['$/'](100.0); self.unit = "%"; return self; }; def.$failure_message_for_should = function() { var self = this; return "expected " + (self.actual) + " to " + (self.$description()); }; def.$failure_message_for_should_not = function() { var self = this; return "expected " + (self.actual) + " not to " + (self.$description()); }; def.$description = function() { var self = this; return "be within " + (self.delta) + (self.unit) + " of " + (self.expected); }; self.$private(); def.$needs_subtractable = function() { var self = this; return $scope.get('ArgumentError').$new("The actual value (" + (self.actual.$inspect()) + ") must respond to `-`"); }; return (def.$needs_expected = function() { var self = this; return $scope.get('ArgumentError').$new("You must set an expected value using #of: be_within(" + (self.delta) + ").of(expected_value)"); }, nil) && 'needs_expected'; })(self, null) })(self) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/matchers/built_in/change"] = 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(['$lambda', '$__send__', '$raise_block_syntax_error', '$evaluate_value_proc', '$call', '$!', '$change_expected?', '$changed?', '$matches_before?', '$matches_after?', '$matches_expected_delta?', '$matches_min?', '$matches_max?', '$raise', '$new', '$===', '$dup', '$expected_matches_actual?', '$message', '$inspect', '$failure_message_for_expected_after', '$actual_delta', '$-', '$private', '$is_a_matcher?', '$description', '$==', '$+', '$>=', '$<=']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Matchers'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'BuiltIn'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Change(){}; var self = $Change = $klass($base, $super, 'Change', $Change); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_3; def.value_proc = def.eval_before = def.expected_before = def.actual_before = def.eval_after = def.expected_after = def.actual_after = def.expected_delta = def.minimum = def.maximum = def.message = nil; def.$initialize = TMP_1 = function(receiver, message) { var $a, $b, $c, TMP_2, self = this, $iter = TMP_1.$$p, block = $iter || nil; if (receiver == null) { receiver = nil } if (message == null) { message = nil } TMP_1.$$p = null; self.message = message; self.value_proc = ((($a = block) !== false && $a !== nil) ? $a : ($b = ($c = self).$lambda, $b.$$p = (TMP_2 = function(){var self = TMP_2.$$s || this; return receiver.$__send__(message)}, TMP_2.$$s = self, TMP_2), $b).call($c)); self.expected_after = self.expected_before = self.minimum = self.maximum = self.expected_delta = nil; return self.eval_before = self.eval_after = false; }; def['$matches?'] = TMP_3 = function(event_proc) { var $a, $b, $c, $d, $e, $f, self = this, $iter = TMP_3.$$p, $yield = $iter || nil; TMP_3.$$p = null; if (($yield !== nil)) { self.$raise_block_syntax_error()}; self.actual_before = self.$evaluate_value_proc(); event_proc.$call(); self.actual_after = self.$evaluate_value_proc(); return ($a = ($b = ($c = ($d = ($e = (((($f = self['$change_expected?']()['$!']()) !== false && $f !== nil) ? $f : self['$changed?']())), $e !== false && $e !== nil ?self['$matches_before?']() : $e), $d !== false && $d !== nil ?self['$matches_after?']() : $d), $c !== false && $c !== nil ?self['$matches_expected_delta?']() : $c), $b !== false && $b !== nil ?self['$matches_min?']() : $b), $a !== false && $a !== nil ?self['$matches_max?']() : $a); }; $opal.defn(self, '$==', def['$matches?']); def.$raise_block_syntax_error = function() { var self = this; return self.$raise($scope.get('SyntaxError').$new("block passed to should or should_not change must use {} instead of do/end\n")); }; def.$evaluate_value_proc = function() { var self = this, $case = nil, val = nil; return (function() {$case = val = self.value_proc.$call();if ($scope.get('Enumerable')['$===']($case) || $scope.get('String')['$===']($case)) {return val.$dup()}else {return val}})(); }; def.$failure_message_for_should = function() { var $a, $b, self = this; if ((($a = ($b = self.eval_before, $b !== false && $b !== nil ?self['$expected_matches_actual?'](self.expected_before, self.actual_before)['$!']() : $b)) !== nil && (!$a.$$is_boolean || $a == true))) { return "" + (self.$message()) + " should have initially been " + (self.expected_before.$inspect()) + ", but was " + (self.actual_before.$inspect()) } else if ((($a = ($b = self.eval_after, $b !== false && $b !== nil ?self['$expected_matches_actual?'](self.expected_after, self.actual_after)['$!']() : $b)) !== nil && (!$a.$$is_boolean || $a == true))) { return "" + (self.$message()) + " should have been changed to " + (self.$failure_message_for_expected_after()) + ", but is now " + (self.actual_after.$inspect()) } else if ((($a = self.expected_delta) !== nil && (!$a.$$is_boolean || $a == true))) { return "" + (self.$message()) + " should have been changed by " + (self.expected_delta.$inspect()) + ", but was changed by " + (self.$actual_delta().$inspect()) } else if ((($a = self.minimum) !== nil && (!$a.$$is_boolean || $a == true))) { return "" + (self.$message()) + " should have been changed by at least " + (self.minimum.$inspect()) + ", but was changed by " + (self.$actual_delta().$inspect()) } else if ((($a = self.maximum) !== nil && (!$a.$$is_boolean || $a == true))) { return "" + (self.$message()) + " should have been changed by at most " + (self.maximum.$inspect()) + ", but was changed by " + (self.$actual_delta().$inspect()) } else { return "" + (self.$message()) + " should have changed, but is still " + (self.actual_before.$inspect()) }; }; def.$actual_delta = function() { var self = this; return self.actual_after['$-'](self.actual_before); }; def.$failure_message_for_should_not = function() { var self = this; return "" + (self.$message()) + " should not have changed, but did change from " + (self.actual_before.$inspect()) + " to " + (self.actual_after.$inspect()); }; def.$by = function(expected_delta) { var self = this; self.expected_delta = expected_delta; return self; }; def.$by_at_least = function(minimum) { var self = this; self.minimum = minimum; return self; }; def.$by_at_most = function(maximum) { var self = this; self.maximum = maximum; return self; }; def.$to = function(to) { var self = this; self.eval_after = true; self.expected_after = to; return self; }; def.$from = function(before) { var self = this; self.eval_before = true; self.expected_before = before; return self; }; def.$description = function() { var self = this; return "change #" + (self.$message()); }; self.$private(); def.$failure_message_for_expected_after = function() { var $a, self = this; if ((($a = (($scope.get('RSpec')).$$scope.get('Matchers'))['$is_a_matcher?'](self.expected_after)) !== nil && (!$a.$$is_boolean || $a == true))) { return self.expected_after.$description() } else { return self.expected_after.$inspect() }; }; def.$message = function() { var $a, self = this; return ((($a = self.message) !== false && $a !== nil) ? $a : "result"); }; def['$change_expected?'] = function() { var self = this; return self.expected_delta['$=='](0)['$!'](); }; def['$changed?'] = function() { var self = this; return self.actual_before['$=='](self.actual_after)['$!'](); }; def['$matches_before?'] = function() { var $a, self = this; if ((($a = self.eval_before) !== nil && (!$a.$$is_boolean || $a == true))) { return self['$expected_matches_actual?'](self.expected_before, self.actual_before) } else { return true }; }; def['$matches_after?'] = function() { var $a, self = this; if ((($a = self.eval_after) !== nil && (!$a.$$is_boolean || $a == true))) { return self['$expected_matches_actual?'](self.expected_after, self.actual_after) } else { return true }; }; def['$matches_expected_delta?'] = function() { var $a, self = this; if ((($a = self.expected_delta) !== nil && (!$a.$$is_boolean || $a == true))) { return (self.actual_before['$+'](self.expected_delta)['$=='](self.actual_after)) } else { return true }; }; def['$matches_min?'] = function() { var $a, self = this; if ((($a = self.minimum) !== nil && (!$a.$$is_boolean || $a == true))) { return (self.actual_after['$-'](self.actual_before)['$>='](self.minimum)) } else { return true }; }; def['$matches_max?'] = function() { var $a, self = this; if ((($a = self.maximum) !== nil && (!$a.$$is_boolean || $a == true))) { return (self.actual_after['$-'](self.actual_before)['$<='](self.maximum)) } else { return true }; }; return (def['$expected_matches_actual?'] = function(expected, actual) { var $a, self = this; return ((($a = expected['$==='](actual)) !== false && $a !== nil) ? $a : actual['$=='](expected)); }, nil) && 'expected_matches_actual?'; })(self, null) })(self) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/matchers/built_in/cover"] = 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(['$all?', '$cover?', '$none?', '$expected']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Matchers'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'BuiltIn'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Cover(){}; var self = $Cover = $klass($base, $super, 'Cover', $Cover); var def = self.$$proto, $scope = self.$$scope; def.expected = nil; def.$initialize = function(expected) { var self = this; expected = $slice.call(arguments, 0); return self.expected = expected; }; def['$matches?'] = function(range) { var $a, $b, TMP_1, self = this; self.actual = range; return ($a = ($b = self.expected)['$all?'], $a.$$p = (TMP_1 = function(e){var self = TMP_1.$$s || this; if (e == null) e = nil; return range['$cover?'](e)}, TMP_1.$$s = self, TMP_1), $a).call($b); }; return (def['$does_not_match?'] = function(range) { var $a, $b, TMP_2, self = this; self.actual = range; return ($a = ($b = self.$expected())['$none?'], $a.$$p = (TMP_2 = function(e){var self = TMP_2.$$s || this; if (e == null) e = nil; return range['$cover?'](e)}, TMP_2.$$s = self, TMP_2), $a).call($b); }, nil) && 'does_not_match?'; })(self, $scope.get('BaseMatcher')) })(self) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/matchers/built_in/eq"] = 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(['$==', '$inspect', '$expected', '$actual']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Matchers'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'BuiltIn'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Eq(){}; var self = $Eq = $klass($base, $super, 'Eq', $Eq); var def = self.$$proto, $scope = self.$$scope; def.$match = function(expected, actual) { var self = this; return actual['$=='](expected); }; def.$failure_message_for_should = function() { var self = this; return "\nexpected: " + (self.$expected().$inspect()) + "\n got: " + (self.$actual().$inspect()) + "\n\n(compared using ==)\n"; }; def.$failure_message_for_should_not = function() { var self = this; return "\nexpected: value != " + (self.$expected().$inspect()) + "\n got: " + (self.$actual().$inspect()) + "\n\n(compared using ==)\n"; }; return (def['$diffable?'] = function() { var self = this; return true; }, nil) && 'diffable?'; })(self, $scope.get('BaseMatcher')) })(self) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/matchers/built_in/eql"] = 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(['$eql?', '$inspect', '$expected', '$actual']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Matchers'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'BuiltIn'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Eql(){}; var self = $Eql = $klass($base, $super, 'Eql', $Eql); var def = self.$$proto, $scope = self.$$scope; def.$match = function(expected, actual) { var self = this; return actual['$eql?'](expected); }; def.$failure_message_for_should = function() { var self = this; return "\nexpected: " + (self.$expected().$inspect()) + "\n got: " + (self.$actual().$inspect()) + "\n\n(compared using eql?)\n"; }; def.$failure_message_for_should_not = function() { var self = this; return "\nexpected: value != " + (self.$expected().$inspect()) + "\n got: " + (self.$actual().$inspect()) + "\n\n(compared using eql?)\n"; }; return (def['$diffable?'] = function() { var self = this; return true; }, nil) && 'diffable?'; })(self, $scope.get('BaseMatcher')) })(self) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/matchers/built_in/equal"] = 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(['$equal?', '$inspect_object', '$expected', '$actual', '$eq_expression', '$private', '$class', '$object_id', '$inspect', '$positive_expression']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Matchers'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'BuiltIn'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Equal(){}; var self = $Equal = $klass($base, $super, 'Equal', $Equal); var def = self.$$proto, $scope = self.$$scope; def.$match = function(expected, actual) { var self = this; return actual['$equal?'](expected); }; def.$failure_message_for_should = function() { var self = this; return "\nexpected " + (self.$inspect_object(self.$expected())) + "\n got " + (self.$inspect_object(self.$actual())) + "\n\nCompared using equal?, which compares object identity,\nbut expected and actual are not the same object. Use\n`" + (self.$eq_expression()) + "` if you don't care about\nobject identity in this example.\n\n"; }; def.$failure_message_for_should_not = function() { var self = this; return "\nexpected not " + (self.$inspect_object(self.$actual())) + "\n got " + (self.$inspect_object(self.$expected())) + "\n\nCompared using equal?, which compares object identity.\n\n"; }; def['$diffable?'] = function() { var self = this; return true; }; self.$private(); def.$inspect_object = function(o) { var self = this; return "#<" + (o.$class()) + ":" + (o.$object_id()) + "> => " + (o.$inspect()); }; return (def.$eq_expression = function() { var self = this; return (($scope.get('Expectations')).$$scope.get('Syntax')).$positive_expression("actual", "eq(expected)"); }, nil) && 'eq_expression'; })(self, $scope.get('BaseMatcher')) })(self) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/matchers/built_in/exist"] = 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(['$select', '$respond_to?', '$map', '$__send__', '$uniq', '$!', '$size', '$===', '$raise', '$new', '$inspect', '$first', '$+', '$last']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Matchers'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'BuiltIn'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Exist(){}; var self = $Exist = $klass($base, $super, 'Exist', $Exist); var def = self.$$proto, $scope = self.$$scope; def.actual = nil; def.$initialize = function(expected) { var self = this; expected = $slice.call(arguments, 0); return self.expected = expected; }; return (def['$matches?'] = function(actual) { var $a, $b, TMP_1, $c, TMP_2, $d, TMP_3, self = this, predicates = nil, existence_values = nil, uniq_truthy_values = nil, $case = nil; self.actual = actual; predicates = ($a = ($b = ["exist?", "exists?"]).$select, $a.$$p = (TMP_1 = function(p){var self = TMP_1.$$s || this; if (self.actual == null) self.actual = nil; if (p == null) p = nil; return self.actual['$respond_to?'](p)}, TMP_1.$$s = self, TMP_1), $a).call($b); existence_values = ($a = ($c = predicates).$map, $a.$$p = (TMP_2 = function(p){var self = TMP_2.$$s || this, $a; if (self.actual == null) self.actual = nil; if (self.expected == null) self.expected = nil; if (p == null) p = nil; return ($a = self.actual).$__send__.apply($a, [p].concat(self.expected))}, TMP_2.$$s = self, TMP_2), $a).call($c); uniq_truthy_values = ($a = ($d = existence_values).$map, $a.$$p = (TMP_3 = function(v){var self = TMP_3.$$s || this; if (v == null) v = nil; return v['$!']()['$!']()}, TMP_3.$$s = self, TMP_3), $a).call($d).$uniq(); return (function() {$case = uniq_truthy_values.$size();if ((0)['$===']($case)) {return self.$raise($scope.get('NoMethodError').$new("" + (self.actual.$inspect()) + " does not respond to either #exist? or #exists?"))}else if ((1)['$===']($case)) {return existence_values.$first()}else {return self.$raise("#exist? and #exists? returned different values:\n\n"['$+'](" exist?: " + (existence_values.$first()) + "\n")['$+']("exists?: " + (existence_values.$last())))}})(); }, nil) && 'matches?'; })(self, $scope.get('BaseMatcher')) })(self) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/matchers/built_in/has"] = 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(['$__send__', '$predicate', '$failure_message_args_description', '$join', '$compact', '$method_description', '$args_description', '$private', '$to_sym', '$sub', '$to_s', '$gsub', '$empty?', '$map', '$inspect']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Matchers'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'BuiltIn'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Has(){}; var self = $Has = $klass($base, $super, 'Has', $Has); var def = self.$$proto, $scope = self.$$scope; def.expected = def.args = nil; def.$initialize = function(expected, args) { var $a, self = this; args = $slice.call(arguments, 1); return $a = [expected, args], self.expected = $a[0], self.args = $a[1]; }; def['$matches?'] = function(actual) { var $a, self = this; return ($a = actual).$__send__.apply($a, [self.$predicate(self.expected)].concat(self.args)); }; $opal.defn(self, '$==', def['$matches?']); def.$failure_message_for_should = function() { var self = this; return "expected #" + (self.$predicate(self.expected)) + (self.$failure_message_args_description()) + " to return true, got false"; }; def.$failure_message_for_should_not = function() { var self = this; return "expected #" + (self.$predicate(self.expected)) + (self.$failure_message_args_description()) + " to return false, got true"; }; def.$description = function() { var self = this; return [self.$method_description(self.expected), self.$args_description()].$compact().$join(" "); }; self.$private(); def.$predicate = function(sym) { var self = this; return ((("") + (sym.$to_s().$sub("have_", "has_"))) + "?").$to_sym(); }; def.$method_description = function(method) { var self = this; return method.$to_s().$gsub("_", " "); }; def.$args_description = function() { var $a, $b, TMP_1, self = this; if ((($a = self.args['$empty?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return nil}; return ($a = ($b = self.args).$map, $a.$$p = (TMP_1 = function(arg){var self = TMP_1.$$s || this; if (arg == null) arg = nil; return arg.$inspect()}, TMP_1.$$s = self, TMP_1), $a).call($b).$join(", "); }; return (def.$failure_message_args_description = function() { var self = this, desc = nil; desc = self.$args_description(); if (desc !== false && desc !== nil) { return "(" + (desc) + ")" } else { return nil }; }, nil) && 'failure_message_args_description'; })(self, null) })(self) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/matchers/built_in/include"] = 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(['$perform_match', '$expected_to_sentence', '$none?', '$is_a_matcher?', '$private', '$__send__', '$comparing_hash_values?', '$has_key?', '$==', '$[]', '$comparing_hash_keys?', '$comparing_with_matcher?', '$actual', '$any?', '$matches?', '$include?', '$is_a?', '$!']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Matchers'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'BuiltIn'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Include(){}; var self = $Include = $klass($base, $super, 'Include', $Include); var def = self.$$proto, $scope = self.$$scope; def.actual = def.expected = nil; def.$initialize = function(expected) { var self = this; expected = $slice.call(arguments, 0); return self.expected = expected; }; def['$matches?'] = function(actual) { var self = this; self.actual = actual; return self.$perform_match("all?", "all?", self.actual, self.expected); }; def['$does_not_match?'] = function(actual) { var self = this; self.actual = actual; return self.$perform_match("none?", "any?", self.actual, self.expected); }; def.$description = function() { var self = this; return "include" + (self.$expected_to_sentence()); }; def['$diffable?'] = function() { var $a, $b, TMP_1, self = this; return ($a = ($b = self.expected)['$none?'], $a.$$p = (TMP_1 = function(e){var self = TMP_1.$$s || this; if (e == null) e = nil; return (($scope.get('RSpec')).$$scope.get('Matchers'))['$is_a_matcher?'](e)}, TMP_1.$$s = self, TMP_1), $a).call($b); }; self.$private(); def.$perform_match = function(predicate, hash_predicate, actuals, expecteds) { var $a, $b, TMP_2, self = this; return ($a = ($b = expecteds).$__send__, $a.$$p = (TMP_2 = function(expected){var self = TMP_2.$$s || this, $a, $b, TMP_3, $c, TMP_4; if (expected == null) expected = nil; if ((($a = self['$comparing_hash_values?'](actuals, expected)) !== nil && (!$a.$$is_boolean || $a == true))) { return ($a = ($b = expected).$__send__, $a.$$p = (TMP_3 = function(k, v){var self = TMP_3.$$s || this, $a; if (k == null) k = nil;if (v == null) v = nil; return ($a = actuals['$has_key?'](k), $a !== false && $a !== nil ?actuals['$[]'](k)['$=='](v) : $a)}, TMP_3.$$s = self, TMP_3), $a).call($b, hash_predicate) } else if ((($a = self['$comparing_hash_keys?'](actuals, expected)) !== nil && (!$a.$$is_boolean || $a == true))) { return actuals['$has_key?'](expected) } else if ((($a = self['$comparing_with_matcher?'](self.$actual(), expected)) !== nil && (!$a.$$is_boolean || $a == true))) { return ($a = ($c = self.$actual())['$any?'], $a.$$p = (TMP_4 = function(value){var self = TMP_4.$$s || this; if (value == null) value = nil; return expected['$matches?'](value)}, TMP_4.$$s = self, TMP_4), $a).call($c) } else { return actuals['$include?'](expected) }}, TMP_2.$$s = self, TMP_2), $a).call($b, predicate); }; def['$comparing_hash_keys?'] = function(actual, expected) { var $a, self = this; return ($a = actual['$is_a?']($scope.get('Hash')), $a !== false && $a !== nil ?expected['$is_a?']($scope.get('Hash'))['$!']() : $a); }; def['$comparing_hash_values?'] = function(actual, expected) { var $a, self = this; return ($a = actual['$is_a?']($scope.get('Hash')), $a !== false && $a !== nil ?expected['$is_a?']($scope.get('Hash')) : $a); }; return (def['$comparing_with_matcher?'] = function(actual, expected) { var $a, self = this; return ($a = actual['$is_a?']($scope.get('Array')), $a !== false && $a !== nil ?(($scope.get('RSpec')).$$scope.get('Matchers'))['$is_a_matcher?'](expected) : $a); }, nil) && 'comparing_with_matcher?'; })(self, $scope.get('BaseMatcher')) })(self) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/matchers/built_in/match"] = 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(['$match']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Matchers'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'BuiltIn'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Match(){}; var self = $Match = $klass($base, $super, 'Match', $Match); var def = self.$$proto, $scope = self.$$scope; def.$match = function(expected, actual) { var self = this; return actual.$match(expected); }; return (def['$diffable?'] = function() { var self = this; return true; }, nil) && 'diffable?'; })(self, $scope.get('BaseMatcher')) })(self) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/matchers/built_in/match_array"] = 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(['$respond_to?', '$difference_between_arrays', '$&', '$empty?', '$actual', '$inspect', '$safe_sort', '$expected', '$+', '$_pretty_print', '$private', '$sort', '$dup', '$to_ary', '$each', '$index', '$delete_at']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Matchers'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'BuiltIn'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $MatchArray(){}; var self = $MatchArray = $klass($base, $super, 'MatchArray', $MatchArray); var def = self.$$proto, $scope = self.$$scope; def.extra_items = def.missing_items = nil; def.$match = function(expected, actual) { var $a, self = this; if ((($a = actual['$respond_to?']("to_ary")) !== nil && (!$a.$$is_boolean || $a == true))) { } else { return false }; self.extra_items = self.$difference_between_arrays(actual, expected); self.missing_items = self.$difference_between_arrays(expected, actual); return self.extra_items['$empty?']()['$&'](self.missing_items['$empty?']()); }; def.$failure_message_for_should = function() { var $a, self = this, message = nil; if ((($a = self.$actual()['$respond_to?']("to_ary")) !== nil && (!$a.$$is_boolean || $a == true))) { message = "expected collection contained: " + (self.$safe_sort(self.$expected()).$inspect()) + "\n"; message = message['$+']("actual collection contained: " + (self.$safe_sort(self.$actual()).$inspect()) + "\n"); if ((($a = self.missing_items['$empty?']()) !== nil && (!$a.$$is_boolean || $a == true))) { } else { message = message['$+']("the missing elements were: " + (self.$safe_sort(self.missing_items).$inspect()) + "\n") }; if ((($a = self.extra_items['$empty?']()) !== nil && (!$a.$$is_boolean || $a == true))) { } else { message = message['$+']("the extra elements were: " + (self.$safe_sort(self.extra_items).$inspect()) + "\n") }; } else { message = "expected an array, actual collection was " + (self.$actual().$inspect()) }; return message; }; def.$failure_message_for_should_not = function() { var self = this; return "Matcher does not support should_not"; }; def.$description = function() { var self = this; return "contain exactly " + (self.$_pretty_print(self.$expected())); }; self.$private(); def.$safe_sort = function(array) { var self = this; try {return array.$sort() } catch ($err) { return array }; }; return (def.$difference_between_arrays = function(array_1, array_2) { var $a, $b, TMP_1, self = this, difference = nil; difference = array_1.$to_ary().$dup(); ($a = ($b = array_2.$to_ary()).$each, $a.$$p = (TMP_1 = function(element){var self = TMP_1.$$s || this, $a, index = nil; if (element == null) element = nil; if ((($a = index = difference.$index(element)) !== nil && (!$a.$$is_boolean || $a == true))) { return difference.$delete_at(index) } else { return nil }}, TMP_1.$$s = self, TMP_1), $a).call($b); return difference; }, nil) && 'difference_between_arrays'; })(self, $scope.get('BaseMatcher')) })(self) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/matchers/built_in/raise_error"] = 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(['$===', '$raise_message_already_set', '$respond_to?', '$warn', '$inspect', '$call', '$==', '$verify_message', '$eval_block', '$expectation_matched?', '$error_and_message_match?', '$block_matches?', '$prevent_invalid_expectations', '$!', '$matches?', '$[]', '$=~', '$message', '$expected_error', '$given_error', '$private', '$expecting_specific_exception?', '$new', '$raise', '$backtrace_formatter', '$configuration', '$format_backtrace', '$backtrace', '$join']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Matchers'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'BuiltIn'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $RaiseError(){}; var self = $RaiseError = $klass($base, $super, 'RaiseError', $RaiseError); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2; def.expected_message = def.block = def.actual_error = def.expected_error = def.raised_expected_error = def.with_expected_message = def.eval_block = def.eval_block_passed = nil; def.$initialize = TMP_1 = function(expected_error_or_message, expected_message) { var $a, self = this, $iter = TMP_1.$$p, block = $iter || nil, $case = nil; if (expected_error_or_message == null) { expected_error_or_message = $scope.get('Exception') } if (expected_message == null) { expected_message = nil } TMP_1.$$p = null; self.block = block; self.actual_error = nil; return (function() {$case = expected_error_or_message;if ($scope.get('String')['$===']($case) || $scope.get('Regexp')['$===']($case)) {return $a = [$scope.get('Exception'), expected_error_or_message], self.expected_error = $a[0], self.expected_message = $a[1]}else {return $a = [expected_error_or_message, expected_message], self.expected_error = $a[0], self.expected_message = $a[1]}})(); }; def.$with_message = function(expected_message) { var $a, self = this; if ((($a = self.expected_message) !== nil && (!$a.$$is_boolean || $a == true))) { self.$raise_message_already_set()}; self.expected_message = expected_message; return self; }; def['$matches?'] = TMP_2 = function(given_proc, negative_expectation) { var $a, $b, $c, self = this, $iter = TMP_2.$$p, block = $iter || nil; if (negative_expectation == null) { negative_expectation = false } TMP_2.$$p = null; ((($a = self.block) !== false && $a !== nil) ? $a : self.block = block); self.raised_expected_error = false; self.with_expected_message = false; self.eval_block = false; self.eval_block_passed = false; if ((($a = given_proc['$respond_to?']("call")) !== nil && (!$a.$$is_boolean || $a == true))) { } else { Opal.get('Kernel').$warn("`raise_error` was called with non-proc object " + (given_proc.$inspect())); return false; }; try { given_proc.$call() } catch ($err) {if ($opal.$rescue($err, [$scope.get('Exception')])) {self.actual_error = $err; if ((($a = ((($b = self.actual_error['$=='](self.expected_error)) !== false && $b !== nil) ? $b : self.expected_error['$==='](self.actual_error))) !== nil && (!$a.$$is_boolean || $a == true))) { self.raised_expected_error = true; self.with_expected_message = self.$verify_message();} }else { throw $err; } }; if (negative_expectation !== false && negative_expectation !== nil) { } else if ((($a = ($b = ($c = self.raised_expected_error, $c !== false && $c !== nil ?self.with_expected_message : $c), $b !== false && $b !== nil ?self.block : $b)) !== nil && (!$a.$$is_boolean || $a == true))) { self.$eval_block()}; return self['$expectation_matched?'](); }; $opal.defn(self, '$==', def['$matches?']); def['$expectation_matched?'] = function() { var $a, self = this; return ($a = self['$error_and_message_match?'](), $a !== false && $a !== nil ?self['$block_matches?']() : $a); }; def['$error_and_message_match?'] = function() { var $a, self = this; return ($a = self.raised_expected_error, $a !== false && $a !== nil ?self.with_expected_message : $a); }; def['$block_matches?'] = function() { var $a, self = this; if ((($a = self.eval_block) !== nil && (!$a.$$is_boolean || $a == true))) { return self.eval_block_passed } else { return true }; }; def['$does_not_match?'] = function(given_proc) { var self = this; self.$prevent_invalid_expectations(); return self['$matches?'](given_proc, "negative_expectation")['$!'](); }; def.$eval_block = function() { var self = this, err = nil; self.eval_block = true; try { self.block['$[]'](self.actual_error); return self.eval_block_passed = true; } catch ($err) {if ($opal.$rescue($err, [$scope.get('Exception')])) {err = $err; return self.actual_error = err }else { throw $err; } }; }; def.$verify_message = function() { var self = this, $case = nil; return (function() {$case = self.expected_message;if (nil['$===']($case)) {return true}else if ($scope.get('Regexp')['$===']($case)) {return self.expected_message['$=~'](self.actual_error.$message())}else {return self.expected_message['$=='](self.actual_error.$message())}})(); }; def.$failure_message_for_should = function() { var $a, self = this; if ((($a = self.eval_block) !== nil && (!$a.$$is_boolean || $a == true))) { return self.actual_error.$message() } else { return "expected " + (self.$expected_error()) + (self.$given_error()) }; }; def.$failure_message_for_should_not = function() { var self = this; return "expected no " + (self.$expected_error()) + (self.$given_error()); }; def.$description = function() { var self = this; return "raise " + (self.$expected_error()); }; self.$private(); def.$prevent_invalid_expectations = function() { var $a, $b, self = this, what_to_raise = nil, specific_class_error = nil; if ((($a = (((($b = self['$expecting_specific_exception?']()) !== false && $b !== nil) ? $b : self.expected_message))) !== nil && (!$a.$$is_boolean || $a == true))) { what_to_raise = (function() {if ((($a = ($b = self['$expecting_specific_exception?'](), $b !== false && $b !== nil ?self.expected_message : $b)) !== nil && (!$a.$$is_boolean || $a == true))) { return "`expect { }.not_to raise_error(SpecificErrorClass, message)`" } else if ((($a = self['$expecting_specific_exception?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return "`expect { }.not_to raise_error(SpecificErrorClass)`" } else if ((($a = self.expected_message) !== nil && (!$a.$$is_boolean || $a == true))) { return "`expect { }.not_to raise_error(message)`" } else { return nil }; return nil; })(); specific_class_error = $scope.get('ArgumentError').$new("" + (what_to_raise) + " is not valid, use `expect { }.not_to raise_error` (with no args) instead"); return self.$raise(specific_class_error); } else { return nil }; }; def.$expected_error = function() { var self = this, $case = nil; return (function() {$case = self.expected_message;if (nil['$===']($case)) {return self.expected_error.$inspect()}else if ($scope.get('Regexp')['$===']($case)) {return "" + (self.expected_error) + " with message matching " + (self.expected_message.$inspect())}else {return "" + (self.expected_error) + " with " + (self.expected_message.$inspect())}})(); }; def.$format_backtrace = function(backtrace) { var self = this, formatter = nil; formatter = $scope.get('Matchers').$configuration().$backtrace_formatter(); return formatter.$format_backtrace(backtrace); }; def.$given_error = function() { var $a, self = this, backtrace = nil; if ((($a = self.actual_error) !== nil && (!$a.$$is_boolean || $a == true))) { } else { return " but nothing was raised" }; backtrace = self.$format_backtrace(self.actual_error.$backtrace()); return [", got " + (self.actual_error.$inspect()) + " with backtrace:"].concat(backtrace).$join("\n # "); }; def['$expecting_specific_exception?'] = function() { var self = this; return self.expected_error['$==']($scope.get('Exception'))['$!'](); }; return (def.$raise_message_already_set = function() { var self = this; return self.$raise("`expect { }.to raise_error(message).with_message(message)` is not valid. The matcher only allows the expected message to be specified once"); }, nil) && 'raise_message_already_set'; })(self, null) })(self) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/matchers/built_in/respond_to"] = 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(['$empty?', '$find_failing_method_names', '$inspect', '$join', '$collect', '$with_arity', '$sub', '$failure_message_for_should', '$pp_names', '$private', '$__send__', '$respond_to?', '$matches_arity?', '$arity', '$method', '$<', '$<=', '$~', '$==', '$nil?', '$length', '$first']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Matchers'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'BuiltIn'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $RespondTo(){}; var self = $RespondTo = $klass($base, $super, 'RespondTo', $RespondTo); var def = self.$$proto, $scope = self.$$scope; def.actual = def.failing_method_names = def.names = def.expected_arity = nil; def.$initialize = function(names) { var self = this; names = $slice.call(arguments, 0); self.names = names; return self.expected_arity = nil; }; def['$matches?'] = function(actual) { var self = this; return self.$find_failing_method_names(actual, "reject")['$empty?'](); }; $opal.defn(self, '$==', def['$matches?']); def['$does_not_match?'] = function(actual) { var self = this; return self.$find_failing_method_names(actual, "select")['$empty?'](); }; def.$failure_message_for_should = function() { var $a, $b, TMP_1, self = this; return "expected " + (self.actual.$inspect()) + " to respond to " + (($a = ($b = self.failing_method_names).$collect, $a.$$p = (TMP_1 = function(name){var self = TMP_1.$$s || this; if (name == null) name = nil; return name.$inspect()}, TMP_1.$$s = self, TMP_1), $a).call($b).$join(", ")) + (self.$with_arity()); }; def.$failure_message_for_should_not = function() { var self = this; return self.$failure_message_for_should().$sub(/to respond to/, "not to respond to"); }; def.$description = function() { var self = this; return "respond to " + (self.$pp_names()) + (self.$with_arity()); }; def.$with = function(n) { var self = this; self.expected_arity = n; return self; }; def.$argument = function() { var self = this; return self; }; $opal.defn(self, '$arguments', def.$argument); self.$private(); def.$find_failing_method_names = function(actual, filter_method) { var $a, $b, TMP_2, self = this; self.actual = actual; return self.failing_method_names = ($a = ($b = self.names).$__send__, $a.$$p = (TMP_2 = function(name){var self = TMP_2.$$s || this, $a; if (self.actual == null) self.actual = nil; if (name == null) name = nil; return ($a = self.actual['$respond_to?'](name), $a !== false && $a !== nil ?self['$matches_arity?'](actual, name) : $a)}, TMP_2.$$s = self, TMP_2), $a).call($b, filter_method); }; def['$matches_arity?'] = function(actual, name) { var $a, self = this, actual_arity = nil; if ((($a = self.expected_arity) !== nil && (!$a.$$is_boolean || $a == true))) { } else { return true }; actual_arity = actual.$method(name).$arity(); if (actual_arity['$<'](0)) { return actual_arity['$~']()['$<='](self.expected_arity) } else { return actual_arity['$=='](self.expected_arity) }; }; def.$with_arity = function() { var $a, self = this; if ((($a = self.expected_arity['$nil?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return "" } else { return " with " + (self.expected_arity) + " argument" + ((function() {if (self.expected_arity['$=='](1)) { return "" } else { return "s" }; return nil; })()) }; }; return (def.$pp_names = function() { var self = this; if (self.names.$length()['$=='](1)) { return "#" + (self.names.$first()) } else { return self.names.$inspect() }; }, nil) && 'pp_names'; })(self, null) })(self) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/matchers/built_in/satisfy"] = 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(['$call']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Matchers'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'BuiltIn'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Satisfy(){}; var self = $Satisfy = $klass($base, $super, 'Satisfy', $Satisfy); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2; def.block = def.actual = nil; def.$initialize = TMP_1 = function() { var self = this, $iter = TMP_1.$$p, block = $iter || nil; TMP_1.$$p = null; return self.block = block; }; def['$matches?'] = TMP_2 = function(actual) { var self = this, $iter = TMP_2.$$p, block = $iter || nil; TMP_2.$$p = null; if (block !== false && block !== nil) { self.block = block}; self.actual = actual; return self.block.$call(actual); }; $opal.defn(self, '$==', def['$matches?']); def.$failure_message_for_should = function() { var self = this; return "expected " + (self.actual) + " to satisfy block"; }; def.$failure_message_for_should_not = function() { var self = this; return "expected " + (self.actual) + " not to satisfy block"; }; return (def.$description = function() { var self = this; return "satisfy block"; }, nil) && 'description'; })(self, null) })(self) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/matchers/built_in/start_and_end_with"] = 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(['$==', '$length', '$first', '$respond_to?', '$raise', '$new', '$inspect', '$subset_matches?', '$element_matches?', '$downcase', '$sub', '$last', '$split', '$name', '$class', '$[]', '$-@']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Matchers'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'BuiltIn'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $StartAndEndWith(){}; var self = $StartAndEndWith = $klass($base, $super, 'StartAndEndWith', $StartAndEndWith); var def = self.$$proto, $scope = self.$$scope; def.expected = def.actual = nil; def.$initialize = function(expected) { var self = this; expected = $slice.call(arguments, 0); return self.expected = (function() {if (expected.$length()['$=='](1)) { return expected.$first() } else { return expected }; return nil; })(); }; def['$matches?'] = function(actual) { var $a, self = this; self.actual = (function() {if ((($a = actual['$respond_to?']("[]")) !== nil && (!$a.$$is_boolean || $a == true))) { return actual } else { return (self.$raise($scope.get('ArgumentError').$new("" + (actual.$inspect()) + " does not respond to :[]"))) }; return nil; })(); try { if ((($a = self.expected['$respond_to?']("length")) !== nil && (!$a.$$is_boolean || $a == true))) { return self['$subset_matches?'](self.expected, self.actual) } else { return self['$element_matches?'](self.expected, self.actual) } } catch ($err) {if ($opal.$rescue($err, [$scope.get('ArgumentError')])) { return self.$raise($scope.get('ArgumentError').$new("" + (actual.$inspect()) + " does not have ordered elements")) }else { throw $err; } }; }; def.$failure_message_for_should = function() { var self = this; return "expected " + (self.actual.$inspect()) + " to " + (self.$class().$name().$split("::").$last().$sub(/With/, "").$downcase()) + " with " + (self.expected.$inspect()); }; return (def.$failure_message_for_should_not = function() { var self = this; return "expected " + (self.actual.$inspect()) + " not to " + (self.$class().$name().$split("::").$last().$sub(/With/, "").$downcase()) + " with " + (self.expected.$inspect()); }, nil) && 'failure_message_for_should_not'; })(self, $scope.get('BaseMatcher')); (function($base, $super) { function $StartWith(){}; var self = $StartWith = $klass($base, $super, 'StartWith', $StartWith); var def = self.$$proto, $scope = self.$$scope; def.actual = def.expected = nil; def['$subset_matches?'] = function(expected, actual) { var self = this; return actual['$[]'](0, expected.$length())['$=='](expected); }; return (def['$element_matches?'] = function(expected, actual) { var self = this; return self.actual['$[]'](0)['$=='](self.expected); }, nil) && 'element_matches?'; })(self, $scope.get('StartAndEndWith')); (function($base, $super) { function $EndWith(){}; var self = $EndWith = $klass($base, $super, 'EndWith', $EndWith); var def = self.$$proto, $scope = self.$$scope; def['$subset_matches?'] = function(expected, actual) { var self = this; return actual['$[]'](expected.$length()['$-@'](), expected.$length())['$=='](expected); }; return (def['$element_matches?'] = function(expected, actual) { var self = this; return actual['$[]'](-1)['$=='](expected); }, nil) && 'element_matches?'; })(self, $scope.get('StartAndEndWith')); })(self) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/matchers/built_in/throw_symbol"] = 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(['$nil?', '$call', '$catch', '$throw', '$==', '$=~', '$message', '$raise', '$to_sym', '$!', '$&', '$expected', '$caught', '$private', '$throw_description', '$is_a?', '$inspect', '$+']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Matchers'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'BuiltIn'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $ThrowSymbol(){}; var self = $ThrowSymbol = $klass($base, $super, 'ThrowSymbol', $ThrowSymbol); var def = self.$$proto, $scope = self.$$scope; def.expected_symbol = def.caught_arg = def.caught_symbol = def.expected_arg = nil; def.$initialize = function(expected_symbol, expected_arg) { var self = this; if (expected_symbol == null) { expected_symbol = nil } if (expected_arg == null) { expected_arg = nil } self.expected_symbol = expected_symbol; self.expected_arg = expected_arg; return self.caught_symbol = self.caught_arg = nil; }; def['$matches?'] = function(given_proc) { var $a, $b, TMP_1, self = this, e = nil, other_exception = nil; try { try { if ((($a = self.expected_symbol['$nil?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return given_proc.$call() } else { self.caught_arg = ($a = ($b = self).$catch, $a.$$p = (TMP_1 = function(){var self = TMP_1.$$s || this, $a, $b, TMP_2; if (self.expected_symbol == null) self.expected_symbol = nil; return ($a = ($b = self).$catch, $a.$$p = (TMP_2 = function(){var self = TMP_2.$$s || this; given_proc.$call(); return self.$throw("proc_did_not_throw_anything", "nothing_thrown");}, TMP_2.$$s = self, TMP_2), $a).call($b, self.expected_symbol)}, TMP_1.$$s = self, TMP_1), $a).call($b, "proc_did_not_throw_anything"); if (self.caught_arg['$==']("nothing_thrown")) { return self.caught_arg = nil } else { return self.caught_symbol = self.expected_symbol }; } } catch ($err) {if ($opal.$rescue($err, [$scope.get('NameError'), $scope.get('ArgumentError')])) {e = $err; if ((($a = e.$message()['$=~'](/uncaught throw (`|\:)([a-zA-Z0-9_]*)(')?/)) !== nil && (!$a.$$is_boolean || $a == true))) { } else { other_exception = e; self.$raise(); }; return self.caught_symbol = nil.$to_sym(); }else if (true) {other_exception = $err; self.$raise() }else { throw $err; } } } finally { if (other_exception !== false && other_exception !== nil) { } else if ((($a = self.expected_symbol['$nil?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return self.caught_symbol['$nil?']()['$!']() } else if ((($a = self.expected_arg['$nil?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return self.caught_symbol['$=='](self.expected_symbol) } else { return (self.caught_symbol['$=='](self.expected_symbol))['$&']((self.caught_arg['$=='](self.expected_arg))) } }; }; $opal.defn(self, '$==', def['$matches?']); def.$failure_message_for_should = function() { var self = this; return "expected " + (self.$expected()) + " to be thrown, got " + (self.$caught()); }; def.$failure_message_for_should_not = function() { var $a, self = this; return "expected " + (self.$expected("no Symbol")) + ((function() {if ((($a = self.expected_symbol) !== nil && (!$a.$$is_boolean || $a == true))) { return " not" } else { return nil }; return nil; })()) + " to be thrown, got " + (self.$caught()); }; def.$description = function() { var self = this; return "throw " + (self.$expected()); }; self.$private(); def.$expected = function(symbol_desc) { var $a, self = this; if (symbol_desc == null) { symbol_desc = "a Symbol" } return self.$throw_description(((($a = self.expected_symbol) !== false && $a !== nil) ? $a : symbol_desc), self.expected_arg); }; def.$caught = function() { var $a, self = this; return self.$throw_description(((($a = self.caught_symbol) !== false && $a !== nil) ? $a : "nothing"), self.caught_arg); }; return (def.$throw_description = function(symbol, arg) { var $a, $b, self = this, symbol_description = nil, arg_description = nil; symbol_description = (function() {if ((($a = symbol['$is_a?']($scope.get('String'))) !== nil && (!$a.$$is_boolean || $a == true))) { return symbol } else { return symbol.$inspect() }; return nil; })(); arg_description = (function() {if (arg !== false && arg !== nil) { return " with " + (arg.$inspect()) } else if ((($a = ($b = self.expected_arg, $b !== false && $b !== nil ?self.caught_symbol['$=='](self.expected_symbol) : $b)) !== nil && (!$a.$$is_boolean || $a == true))) { return " with no argument" } else { return "" }; return nil; })(); return symbol_description['$+'](arg_description); }, nil) && 'throw_description'; })(self, null) })(self) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/matchers/built_in/yield"] = 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(['$new', '$assert_valid_expect_block!', '$call', '$assert_used!', '$attr_accessor', '$num_yields=', '$yielded_args=', '$+', '$num_yields', '$<<', '$yielded_args', '$first', '$===', '$raise', '$map', '$==', '$size', '$arity', '$probe', '$send', '$yielded_once?', '$exactly', '$set_expected_yields_count', '$tap', '$relativity_failure_message', '$private', '$human_readable_expecation_type', '$human_readable_count', '$empty?', '$single_yield_args', '$failure_reason', '$zero?', '$inspect', '$args_match?', '$positive_failure_reason', '$negative_failure_reason', '$join', '$all_args_match?', '$!', '$all?', '$zip', '$successive_yield_args']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Matchers'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'BuiltIn'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $YieldProbe(){}; var self = $YieldProbe = $klass($base, $super, 'YieldProbe', $YieldProbe); var def = self.$$proto, $scope = self.$$scope; def.used = nil; $opal.defs(self, '$probe', function(block) { var self = this, probe = nil; probe = self.$new(); self['$assert_valid_expect_block!'](block); block.$call(probe); probe['$assert_used!'](); return probe; }); self.$attr_accessor("num_yields", "yielded_args"); def.$initialize = function() { var $a, self = this; self.used = false; return $a = [0, []], self['$num_yields=']($a[0]), self['$yielded_args=']($a[1]); }; def.$to_proc = function() { var $a, $b, TMP_1, self = this, probe = nil; self.used = true; probe = self; return ($a = ($b = $scope.get('Proc')).$new, $a.$$p = (TMP_1 = function(args){var self = TMP_1.$$s || this, $a; args = $slice.call(arguments, 0); ($a = probe, $a['$num_yields=']($a.$num_yields()['$+'](1))); probe.$yielded_args()['$<<'](args); return nil;}, TMP_1.$$s = self, TMP_1), $a).call($b); }; def.$single_yield_args = function() { var self = this; return self.$yielded_args().$first(); }; def['$yielded_once?'] = function(matcher_name) { var self = this, $case = nil; return (function() {$case = self.$num_yields();if ((1)['$===']($case)) {return true}else if ((0)['$===']($case)) {return false}else {return self.$raise(((("The ") + (matcher_name)) + " matcher is not designed to be used with a ")['$+']("method that yields multiple times. Use the yield_successive_args ")['$+']("matcher for that case."))}})(); }; def.$successive_yield_args = function() { var $a, $b, TMP_2, self = this; return ($a = ($b = self.$yielded_args()).$map, $a.$$p = (TMP_2 = function(arg_array){var self = TMP_2.$$s || this; if (arg_array == null) arg_array = nil; if (arg_array.$size()['$=='](1)) { return arg_array.$first() } else { return arg_array }}, TMP_2.$$s = self, TMP_2), $a).call($b); }; def['$assert_used!'] = function() { var $a, self = this; if ((($a = self.used) !== nil && (!$a.$$is_boolean || $a == true))) { return nil}; return self.$raise("You must pass the argument yielded to your expect block on "['$+']("to the method-under-test as a block. It acts as a probe that ")['$+']("allows the matcher to detect whether or not the method-under-test ")['$+']("yields, and, if so, how many times, and what the yielded arguments ")['$+']("are.")); }; return ($opal.defs(self, '$assert_valid_expect_block!', function(block) { var self = this; if (block.$arity()['$=='](1)) { return nil}; return self.$raise("Your expect block must accept an argument to be used with this "['$+']("matcher. Pass the argument as a block on to the method you are testing.")); }), nil) && 'assert_valid_expect_block!'; })(self, null); (function($base, $super) { function $YieldControl(){}; var self = $YieldControl = $klass($base, $super, 'YieldControl', $YieldControl); var def = self.$$proto, $scope = self.$$scope; def.expectation_type = def.expected_yields_count = nil; def.$initialize = function() { var self = this; self.expectation_type = nil; return self.expected_yields_count = nil; }; def['$matches?'] = function(block) { var $a, self = this, probe = nil; probe = $scope.get('YieldProbe').$probe(block); if ((($a = self.expectation_type) !== nil && (!$a.$$is_boolean || $a == true))) { return probe.$num_yields().$send(self.expectation_type, self.expected_yields_count) } else { return probe['$yielded_once?']("yield_control") }; }; def.$once = function() { var self = this; self.$exactly(1); return self; }; def.$twice = function() { var self = this; self.$exactly(2); return self; }; def.$exactly = function(number) { var self = this; self.$set_expected_yields_count("==", number); return self; }; def.$at_most = function(number) { var self = this; self.$set_expected_yields_count("<=", number); return self; }; def.$at_least = function(number) { var self = this; self.$set_expected_yields_count(">=", number); return self; }; def.$times = function() { var self = this; return self; }; def.$failure_message_for_should = function() { var $a, $b, TMP_3, self = this; return ($a = ($b = "expected given block to yield control").$tap, $a.$$p = (TMP_3 = function(failure_message){var self = TMP_3.$$s || this; if (failure_message == null) failure_message = nil; return failure_message['$<<'](self.$relativity_failure_message())}, TMP_3.$$s = self, TMP_3), $a).call($b); }; def.$failure_message_for_should_not = function() { var $a, $b, TMP_4, self = this; return ($a = ($b = "expected given block not to yield control").$tap, $a.$$p = (TMP_4 = function(failure_message){var self = TMP_4.$$s || this; if (failure_message == null) failure_message = nil; return failure_message['$<<'](self.$relativity_failure_message())}, TMP_4.$$s = self, TMP_4), $a).call($b); }; self.$private(); def.$set_expected_yields_count = function(relativity, n) { var self = this, $case = nil; self.expectation_type = relativity; return self.expected_yields_count = (function() {$case = n;if ($scope.get('Numeric')['$===']($case)) {return n}else if ("once"['$===']($case)) {return 1}else if ("twice"['$===']($case)) {return 2}else { return nil }})(); }; def.$relativity_failure_message = function() { var $a, self = this; if ((($a = self.expected_yields_count) !== nil && (!$a.$$is_boolean || $a == true))) { } else { return "" }; return " " + (self.$human_readable_expecation_type()) + (self.$human_readable_count()); }; def.$human_readable_expecation_type = function() { var self = this, $case = nil; return (function() {$case = self.expectation_type;if ("<="['$===']($case)) {return "at most "}else if (">="['$===']($case)) {return "at least "}else {return ""}})(); }; return (def.$human_readable_count = function() { var self = this, $case = nil; return (function() {$case = self.expected_yields_count;if ((1)['$===']($case)) {return "once"}else if ((2)['$===']($case)) {return "twice"}else {return "" + (self.expected_yields_count) + " times"}})(); }, nil) && 'human_readable_count'; })(self, $scope.get('BaseMatcher')); (function($base, $super) { function $YieldWithNoArgs(){}; var self = $YieldWithNoArgs = $klass($base, $super, 'YieldWithNoArgs', $YieldWithNoArgs); var def = self.$$proto, $scope = self.$$scope; def.probe = nil; def['$matches?'] = function(block) { var $a, self = this; self.probe = $scope.get('YieldProbe').$probe(block); return ($a = self.probe['$yielded_once?']("yield_with_no_args"), $a !== false && $a !== nil ?self.probe.$single_yield_args()['$empty?']() : $a); }; def.$failure_message_for_should = function() { var self = this; return "expected given block to yield with no arguments, but " + (self.$failure_reason()); }; def.$failure_message_for_should_not = function() { var self = this; return "expected given block not to yield with no arguments, but did"; }; self.$private(); return (def.$failure_reason = function() { var $a, self = this; if ((($a = self.probe.$num_yields()['$zero?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return "did not yield" } else { return "yielded with arguments: " + (self.probe.$single_yield_args().$inspect()) }; }, nil) && 'failure_reason'; })(self, $scope.get('BaseMatcher')); (function($base, $super) { function $YieldWithArgs(){}; var self = $YieldWithArgs = $klass($base, $super, 'YieldWithArgs', $YieldWithArgs); var def = self.$$proto, $scope = self.$$scope; def.probe = def.expected = def.positive_args_failure = def.actual = nil; def.$initialize = function(args) { var self = this; args = $slice.call(arguments, 0); return self.expected = args; }; def['$matches?'] = function(block) { var $a, self = this; self.probe = $scope.get('YieldProbe').$probe(block); self.actual = self.probe.$single_yield_args(); return ($a = self.probe['$yielded_once?']("yield_with_args"), $a !== false && $a !== nil ?self['$args_match?']() : $a); }; $opal.defn(self, '$==', def['$matches?']); def.$failure_message_for_should = function() { var self = this; return "expected given block to yield with arguments, but " + (self.$positive_failure_reason()); }; def.$failure_message_for_should_not = function() { var self = this; return "expected given block not to yield with arguments, but " + (self.$negative_failure_reason()); }; def.$description = function() { var $a, $b, TMP_5, self = this, desc = nil; desc = "yield with args"; if ((($a = self.expected['$empty?']()) !== nil && (!$a.$$is_boolean || $a == true))) { } else { desc['$<<']("("['$+'](($a = ($b = self.expected).$map, $a.$$p = (TMP_5 = function(e){var self = TMP_5.$$s || this; if (e == null) e = nil; return e.$inspect()}, TMP_5.$$s = self, TMP_5), $a).call($b).$join(", "))['$+'](")")) }; return desc; }; self.$private(); def.$positive_failure_reason = function() { var $a, self = this; if ((($a = self.probe.$num_yields()['$zero?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return "did not yield" } else { return self.positive_args_failure }; }; def.$negative_failure_reason = function() { var $a, self = this; if ((($a = self['$all_args_match?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return "yielded with expected arguments"['$+']("\nexpected not: " + (self.expected.$inspect()))['$+']("\n got: " + (self.actual.$inspect()) + " (compared using === and ==)") } else { return "did" }; }; def['$args_match?'] = function() { var $a, self = this, match = nil; if ((($a = self.expected['$empty?']()) !== nil && (!$a.$$is_boolean || $a == true))) { if ((($a = self.actual['$empty?']()) !== nil && (!$a.$$is_boolean || $a == true))) { self.positive_args_failure = "yielded with no arguments"}; return self.actual['$empty?']()['$!']();}; if ((($a = match = self['$all_args_match?']()) !== nil && (!$a.$$is_boolean || $a == true))) { } else { self.positive_args_failure = "yielded with unexpected arguments"['$+']("\nexpected: " + (self.expected.$inspect()))['$+']("\n got: " + (self.actual.$inspect()) + " (compared using === and ==)") }; return match; }; return (def['$all_args_match?'] = function() { var $a, $b, TMP_6, self = this; if ((($a = self.expected.$size()['$=='](self.actual.$size())['$!']()) !== nil && (!$a.$$is_boolean || $a == true))) { return false}; return ($a = ($b = self.expected.$zip(self.actual))['$all?'], $a.$$p = (TMP_6 = function(expected, actual){var self = TMP_6.$$s || this, $a; if (expected == null) expected = nil;if (actual == null) actual = nil; return ((($a = expected['$==='](actual)) !== false && $a !== nil) ? $a : actual['$=='](expected))}, TMP_6.$$s = self, TMP_6), $a).call($b); }, nil) && 'all_args_match?'; })(self, null); (function($base, $super) { function $YieldSuccessiveArgs(){}; var self = $YieldSuccessiveArgs = $klass($base, $super, 'YieldSuccessiveArgs', $YieldSuccessiveArgs); var def = self.$$proto, $scope = self.$$scope; def.probe = def.expected = def.actual = nil; def.$initialize = function(args) { var self = this; args = $slice.call(arguments, 0); return self.expected = args; }; def['$matches?'] = function(block) { var self = this; self.probe = $scope.get('YieldProbe').$probe(block); self.actual = self.probe.$successive_yield_args(); return self['$args_match?'](); }; $opal.defn(self, '$==', def['$matches?']); def.$failure_message_for_should = function() { var self = this; return "expected given block to yield successively with arguments, but yielded with unexpected arguments"['$+']("\nexpected: " + (self.expected.$inspect()))['$+']("\n got: " + (self.actual.$inspect()) + " (compared using === and ==)"); }; def.$failure_message_for_should_not = function() { var self = this; return "expected given block not to yield successively with arguments, but yielded with expected arguments"['$+']("\nexpected not: " + (self.expected.$inspect()))['$+']("\n got: " + (self.actual.$inspect()) + " (compared using === and ==)"); }; def.$description = function() { var $a, $b, TMP_7, self = this, desc = nil; desc = "yield successive args"; desc['$<<']("("['$+'](($a = ($b = self.expected).$map, $a.$$p = (TMP_7 = function(e){var self = TMP_7.$$s || this; if (e == null) e = nil; return e.$inspect()}, TMP_7.$$s = self, TMP_7), $a).call($b).$join(", "))['$+'](")")); return desc; }; self.$private(); return (def['$args_match?'] = function() { var $a, $b, TMP_8, self = this; if ((($a = self.expected.$size()['$=='](self.actual.$size())['$!']()) !== nil && (!$a.$$is_boolean || $a == true))) { return false}; return ($a = ($b = self.expected.$zip(self.actual))['$all?'], $a.$$p = (TMP_8 = function(expected, actual){var self = TMP_8.$$s || this, $a; if (expected == null) expected = nil;if (actual == null) actual = nil; return ((($a = expected['$==='](actual)) !== false && $a !== nil) ? $a : actual['$=='](expected))}, TMP_8.$$s = self, TMP_8), $a).call($b); }, nil) && 'args_match?'; })(self, null); })(self) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/matchers/built_in"] = 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, $range = $opal.range; $opal.add_stubs(['$require', '$autoload', '$respond_to?']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Matchers'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'BuiltIn'); var def = self.$$proto, $scope = self.$$scope, $a; self.$require("rspec/matchers/built_in/base_matcher"); self.$autoload("BeAnInstanceOf", "rspec/matchers/built_in/be_instance_of"); self.$autoload("Be", "rspec/matchers/built_in/be"); self.$autoload("BeTruthy", "rspec/matchers/built_in/be"); self.$autoload("BeFalsey", "rspec/matchers/built_in/be"); self.$autoload("BeNil", "rspec/matchers/built_in/be"); self.$autoload("BeComparedTo", "rspec/matchers/built_in/be"); self.$autoload("BePredicate", "rspec/matchers/built_in/be"); self.$autoload("BeAKindOf", "rspec/matchers/built_in/be_kind_of"); self.$autoload("BeWithin", "rspec/matchers/built_in/be_within"); self.$autoload("Change", "rspec/matchers/built_in/change"); if ((($a = ($range(1, 2, false))['$respond_to?']("cover?")) !== nil && (!$a.$$is_boolean || $a == true))) { self.$autoload("Cover", "rspec/matchers/built_in/cover")}; self.$autoload("Eq", "rspec/matchers/built_in/eq"); self.$autoload("Eql", "rspec/matchers/built_in/eql"); self.$autoload("Equal", "rspec/matchers/built_in/equal"); self.$autoload("Exist", "rspec/matchers/built_in/exist"); self.$autoload("Has", "rspec/matchers/built_in/has"); self.$autoload("Have", "rspec/matchers/built_in/have"); self.$autoload("Include", "rspec/matchers/built_in/include"); self.$autoload("Match", "rspec/matchers/built_in/match"); self.$autoload("MatchArray", "rspec/matchers/built_in/match_array"); self.$autoload("RaiseError", "rspec/matchers/built_in/raise_error"); self.$autoload("RespondTo", "rspec/matchers/built_in/respond_to"); self.$autoload("StartWith", "rspec/matchers/built_in/start_and_end_with"); self.$autoload("EndWith", "rspec/matchers/built_in/start_and_end_with"); self.$autoload("Satisfy", "rspec/matchers/built_in/satisfy"); self.$autoload("ThrowSymbol", "rspec/matchers/built_in/throw_symbol"); self.$autoload("YieldControl", "rspec/matchers/built_in/yield"); self.$autoload("YieldWithArgs", "rspec/matchers/built_in/yield"); self.$autoload("YieldWithNoArgs", "rspec/matchers/built_in/yield"); self.$autoload("YieldSuccessiveArgs", "rspec/matchers/built_in/yield"); })(self) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/matchers/compatibility"] = function($opal) { $opal.dynamic_require_severity = "warning"; var $a, $b, TMP_1, self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice; $opal.add_stubs(['$each', '$===', '$const_get', '$any?', '$include?', '$public_instance_methods', '$class_exec', '$alias_method', '$constants']); return ($a = ($b = (($scope.get('RSpec')).$$scope.get('Matchers')).$constants()).$each, $a.$$p = (TMP_1 = function(c){var self = TMP_1.$$s || this, $a, $b, $c, TMP_2, TMP_3, $d, $e, TMP_4, TMP_5, klass = nil; if (c == null) c = nil; if ((($a = $scope.get('Class')['$===']((klass = (($scope.get('RSpec')).$$scope.get('Matchers')).$const_get(c)))) !== nil && (!$a.$$is_boolean || $a == true))) { if ((($a = ($b = ($c = klass.$public_instance_methods())['$any?'], $b.$$p = (TMP_2 = function(m){var self = TMP_2.$$s || this; if (m == null) m = nil; return ["failure_message_for_should", "failure_message_for_should"]['$include?'](m)}, TMP_2.$$s = self, TMP_2), $b).call($c)) !== nil && (!$a.$$is_boolean || $a == true))) { ($a = ($b = klass).$class_exec, $a.$$p = (TMP_3 = function(){var self = TMP_3.$$s || this; return self.$alias_method("failure_message", "failure_message_for_should")}, TMP_3.$$s = self, TMP_3), $a).call($b)}; if ((($a = ($d = ($e = klass.$public_instance_methods())['$any?'], $d.$$p = (TMP_4 = function(m){var self = TMP_4.$$s || this; if (m == null) m = nil; return ["failure_message_for_should_not", "failure_message_for_should_not"]['$include?'](m)}, TMP_4.$$s = self, TMP_4), $d).call($e)) !== nil && (!$a.$$is_boolean || $a == true))) { return ($a = ($d = klass).$class_exec, $a.$$p = (TMP_5 = function(){var self = TMP_5.$$s || this; return self.$alias_method("negative_failure_message", "failure_message_for_should_not")}, TMP_5.$$s = self, TMP_5), $a).call($d) } else { return nil }; } else { return nil }}, TMP_1.$$s = self, TMP_1), $a).call($b) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/matchers/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; $opal.add_stubs(['$require', '$include?', '$Array', '$enable_expect', '$disable_expect', '$enable_should', '$disable_should', '$should_enabled?', '$<<', '$expect_enabled?', '$respond_to?', '$color_enabled?', '$configuration', '$attr_writer', '$each', '$syntax=', '$warn_about_should!', '$new', '$reset_syntaxes_to_default']); self.$require("rspec/expectations/syntax"); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Matchers'); 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, $a, $b, TMP_2; def.color = def.backtrace_formatter = nil; def['$syntax='] = function(values) { var $a, self = this; if ((($a = self.$Array(values)['$include?']("expect")) !== nil && (!$a.$$is_boolean || $a == true))) { (($scope.get('Expectations')).$$scope.get('Syntax')).$enable_expect() } else { (($scope.get('Expectations')).$$scope.get('Syntax')).$disable_expect() }; if ((($a = self.$Array(values)['$include?']("should")) !== nil && (!$a.$$is_boolean || $a == true))) { return (($scope.get('Expectations')).$$scope.get('Syntax')).$enable_should() } else { return (($scope.get('Expectations')).$$scope.get('Syntax')).$disable_should() }; }; def.$syntax = function() { var $a, self = this, syntaxes = nil; syntaxes = []; if ((($a = (($scope.get('Expectations')).$$scope.get('Syntax'))['$should_enabled?']()) !== nil && (!$a.$$is_boolean || $a == true))) { syntaxes['$<<']("should")}; if ((($a = (($scope.get('Expectations')).$$scope.get('Syntax'))['$expect_enabled?']()) !== nil && (!$a.$$is_boolean || $a == true))) { syntaxes['$<<']("expect")}; return syntaxes; }; if ((($a = Opal.get('RSpec')['$respond_to?']("configuration")) !== nil && (!$a.$$is_boolean || $a == true))) { def['$color?'] = function() { var self = this; return Opal.get('RSpec').$configuration()['$color_enabled?'](); } } else { self.$attr_writer("color"); def['$color?'] = function() { var self = this; return self.color; }; }; def.$add_should_and_should_not_to = function(modules) { var $a, $b, TMP_1, self = this; modules = $slice.call(arguments, 0); return ($a = ($b = modules).$each, $a.$$p = (TMP_1 = function(mod){var self = TMP_1.$$s || this; if (mod == null) mod = nil; return (($scope.get('Expectations')).$$scope.get('Syntax')).$enable_should(mod)}, TMP_1.$$s = self, TMP_1), $a).call($b); }; self.$attr_writer("backtrace_formatter"); def.$backtrace_formatter = function() { var $a, $b, self = this; return ((($a = self.backtrace_formatter) !== false && $a !== nil) ? $a : self.backtrace_formatter = (function() {if ((($b = (function(){ try { return ((((((Opal.get('RSpec')).$$scope.get('Core'))).$$scope.get('BacktraceFormatter'))) != null ? 'constant' : nil); } catch (err) { if (err.$$class === Opal.NameError) { return nil; } else { throw(err); }}; })()) !== nil && (!$b.$$is_boolean || $b == true))) { return ((((Opal.get('RSpec')).$$scope.get('Core'))).$$scope.get('BacktraceFormatter')) } else { return $scope.get('NullBacktraceFormatter') }; return nil; })()); }; def.$reset_syntaxes_to_default = function() { var $a, $b, self = this; (($a = [["should", "expect"]]), $b = self, $b['$syntax='].apply($b, $a), $a[$a.length-1]); return (((($scope.get('RSpec')).$$scope.get('Expectations'))).$$scope.get('Syntax'))['$warn_about_should!'](); }; return $opal.cdecl($scope, 'NullBacktraceFormatter', ($a = ($b = $scope.get('Module')).$new, $a.$$p = (TMP_2 = function(){var self = TMP_2.$$s || this; return ($opal.defs(self, '$format_backtrace', function(backtrace) { var self = this; return backtrace; }), nil) && 'format_backtrace'}, TMP_2.$$s = self, TMP_2), $a).call($b)); })(self, null); $opal.defs(self, '$configuration', function() { var $a, self = this; if (self.configuration == null) self.configuration = nil; return ((($a = self.configuration) !== false && $a !== nil) ? $a : self.configuration = $scope.get('Configuration').$new()); }); self.$configuration().$reset_syntaxes_to_default(); })(self) })(self); }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/matchers/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(['$define_method', '$new', '$matcher_execution_context=', '$alias_method', '$respond_to?', '$configure', '$extend']); (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Matchers'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'DSL'); var def = self.$$proto, $scope = self.$$scope, TMP_1, $a, $b, TMP_3; def.$define = TMP_1 = function(name) { var $a, $b, TMP_2, self = this, $iter = TMP_1.$$p, declarations = $iter || nil; TMP_1.$$p = null; return ($a = ($b = self).$define_method, $a.$$p = (TMP_2 = function(expected){var self = TMP_2.$$s || this, $a, $b, $c, $d, matcher = nil; if (self.matcher_execution_context == null) self.matcher_execution_context = nil; expected = $slice.call(arguments, 0); matcher = ($a = (((((($scope.get('RSpec')).$$scope.get('Matchers'))).$$scope.get('DSL'))).$$scope.get('Matcher'))).$new.apply($a, [name, declarations].concat(expected)); (($b = [((($d = self.matcher_execution_context) !== false && $d !== nil) ? $d : self.matcher_execution_context = self)]), $c = matcher, $c['$matcher_execution_context='].apply($c, $b), $b[$b.length-1]); return matcher;}, TMP_2.$$s = self, TMP_2), $a).call($b, name); }; self.$alias_method("matcher", "define"); if ((($a = $scope.get('RSpec')['$respond_to?']("configure")) !== nil && (!$a.$$is_boolean || $a == true))) { ($a = ($b = $scope.get('RSpec')).$configure, $a.$$p = (TMP_3 = function(c){var self = TMP_3.$$s || this; if (c == null) c = nil; return c.$extend(self)}, TMP_3.$$s = self, TMP_3), $a).call($b)}; ;$opal.donate(self, ["$define"]); })(self) })(self) })(self); return (($scope.get('RSpec')).$$scope.get('Matchers')).$extend((((($scope.get('RSpec')).$$scope.get('Matchers'))).$$scope.get('DSL'))); }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/matchers/generated_descriptions"] = 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(['$attr_accessor', '$last_matcher=', '$last_should=', '$nil?', '$last_should', '$gsub', '$to_s', '$last_description', '$private', '$respond_to?', '$last_matcher', '$description']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Matchers'); var def = self.$$proto, $scope = self.$$scope; (function(self) { var $scope = self.$$scope, def = self.$$proto; return self.$attr_accessor("last_matcher", "last_should") })(self.$singleton_class()); $opal.defs(self, '$clear_generated_description', function() { var $a, $b, self = this; (($a = [nil]), $b = self, $b['$last_matcher='].apply($b, $a), $a[$a.length-1]); return (($a = [nil]), $b = self, $b['$last_should='].apply($b, $a), $a[$a.length-1]); }); $opal.defs(self, '$generated_description', function() { var $a, self = this; if ((($a = self.$last_should()['$nil?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return nil}; return "" + (self.$last_should().$to_s().$gsub("_", " ")) + " " + (self.$last_description()); }); self.$private(); $opal.defs(self, '$last_description', function() { var $a, self = this; if ((($a = self.$last_matcher()['$respond_to?']("description")) !== nil && (!$a.$$is_boolean || $a == true))) { return self.$last_matcher().$description() } else { return "When you call a matcher in an example without a String, like this:\n\nspecify { object.should matcher }\n\nor this:\n\nit { should matcher }\n\nRSpec expects the matcher to have a #description method. You should either\nadd a String to the example this matcher is being used in, or give it a\ndescription method. Then you won't have to suffer this lengthy warning again.\n" }; }); })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/matchers/matcher"] = 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', '$define_user_override', '$actual_arg_for', '$define_method', '$to_proc', '$private', '$__send__', '$lambda', '$name_to_sentence', '$expected_to_sentence', '$inspect', '$actual', '$include', '$extend', '$attr_reader', '$attr_accessor', '$class_exec', '$new', '$name', '$class', '$>=', '$to_f', '$respond_to?', '$matcher_execution_context', '$zero?', '$arity']); self.$require("set"); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Matchers'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'DSL'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Macros'); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_3, TMP_5, TMP_7, TMP_8, TMP_9, TMP_11, TMP_13; def.$match = TMP_1 = function() { var $a, $b, TMP_2, self = this, $iter = TMP_1.$$p, match_block = $iter || nil; TMP_1.$$p = null; return ($a = ($b = self).$define_user_override, $a.$$p = (TMP_2 = function(actual){var self = TMP_2.$$s || this; if (actual == null) actual = nil; try { self.actual = actual; return $opal.find_iter_super_dispatcher(self, 'match', (TMP_2.$$def || TMP_1), null).apply(self, [].concat(self.$actual_arg_for(match_block))); } catch ($err) {if ($opal.$rescue($err, [(((($scope.get('RSpec')).$$scope.get('Expectations'))).$$scope.get('ExpectationNotMetError'))])) { return false }else { throw $err; } }}, TMP_2.$$s = self, TMP_2), $a).call($b, "matches?", match_block); }; $opal.defn(self, '$match_for_should', def.$match); def.$match_for_should_not = TMP_3 = function() { var $a, $b, TMP_4, self = this, $iter = TMP_3.$$p, match_block = $iter || nil; TMP_3.$$p = null; return ($a = ($b = self).$define_user_override, $a.$$p = (TMP_4 = function(actual){var self = TMP_4.$$s || this; if (actual == null) actual = nil; self.actual = actual; return $opal.find_iter_super_dispatcher(self, 'match_for_should_not', (TMP_4.$$def || TMP_3), null).apply(self, [].concat(self.$actual_arg_for(match_block)));}, TMP_4.$$s = self, TMP_4), $a).call($b, "does_not_match?", match_block); }; def.$match_unless_raises = TMP_5 = function(expected_exception) { var $a, $b, TMP_6, self = this, $iter = TMP_5.$$p, match_block = $iter || nil; if (expected_exception == null) { expected_exception = $scope.get('Exception') } TMP_5.$$p = null; return ($a = ($b = self).$define_user_override, $a.$$p = (TMP_6 = function(actual){var self = TMP_6.$$s || this; if (actual == null) actual = nil; self.actual = actual; try { return $opal.find_iter_super_dispatcher(self, 'match_unless_raises', (TMP_6.$$def || TMP_5), null).apply(self, [].concat(self.$actual_arg_for(match_block))) } catch ($err) {if ($opal.$rescue($err, [expected_exception])) {self.rescued_exception = $err; return false }else true };}, TMP_6.$$s = self, TMP_6), $a).call($b, "matches?", match_block); }; def.$failure_message_for_should = TMP_7 = function() { var self = this, $iter = TMP_7.$$p, definition = $iter || nil; TMP_7.$$p = null; return self.$define_user_override("failure_message_for_should", definition); }; def.$failure_message_for_should_not = TMP_8 = function() { var self = this, $iter = TMP_8.$$p, definition = $iter || nil; TMP_8.$$p = null; return self.$define_user_override("failure_message_for_should_not", definition); }; def.$description = TMP_9 = function() { var self = this, $iter = TMP_9.$$p, definition = $iter || nil; TMP_9.$$p = null; return self.$define_user_override("description", definition); }; def.$diffable = function() { var $a, $b, TMP_10, self = this; return ($a = ($b = self).$define_method, $a.$$p = (TMP_10 = function(){var self = TMP_10.$$s || this; return true}, TMP_10.$$s = self, TMP_10), $a).call($b, "diffable?"); }; def.$chain = TMP_11 = function(name) { var $a, $b, TMP_12, self = this, $iter = TMP_11.$$p, definition = $iter || nil; TMP_11.$$p = null; return ($a = ($b = self).$define_user_override, $a.$$p = (TMP_12 = function(args){var self = TMP_12.$$s || this, block; args = $slice.call(arguments, 0); block = TMP_12.$$p || nil, TMP_12.$$p = null; $opal.find_iter_super_dispatcher(self, 'chain', (TMP_12.$$def || TMP_11), null).apply(self, [].concat(args).concat(block.$to_proc())); return self;}, TMP_12.$$s = self, TMP_12), $a).call($b, name, definition); }; self.$private(); def.$define_user_override = TMP_13 = function(method_name, user_def) { var $a, $b, $c, $d, TMP_14, self = this, $iter = TMP_13.$$p, our_def = $iter || nil; if (self.user_method_defs == null) self.user_method_defs = nil; TMP_13.$$p = null; ($a = ($b = self.user_method_defs).$__send__, $a.$$p = user_def.$to_proc(), $a).call($b, "define_method", method_name); ((($a = our_def) !== false && $a !== nil) ? $a : our_def = ($c = ($d = self).$lambda, $c.$$p = (TMP_14 = function(){var self = TMP_14.$$s || this; return $opal.find_iter_super_dispatcher(self, 'define_user_override', (TMP_14.$$def || TMP_13), null).apply(self, [].concat(self.$actual_arg_for(user_def)))}, TMP_14.$$s = self, TMP_14), $c).call($d)); return ($a = ($c = self).$define_method, $a.$$p = our_def.$to_proc(), $a).call($c, method_name); }; ;$opal.donate(self, ["$match", "$match_for_should", "$match_for_should_not", "$match_unless_raises", "$failure_message_for_should", "$failure_message_for_should_not", "$description", "$diffable", "$chain", "$define_user_override"]); })(self); (function($base) { var self = $module($base, 'DefaultImplementations'); var def = self.$$proto, $scope = self.$$scope; def['$diffable?'] = function() { var self = this; return false; }; def.$description = function() { var self = this; return "" + (self.$name_to_sentence()) + (self.$expected_to_sentence()); }; def.$failure_message_for_should = function() { var self = this; return "expected " + (self.$actual().$inspect()) + " to " + (self.$name_to_sentence()) + (self.$expected_to_sentence()); }; def.$failure_message_for_should_not = function() { var self = this; return "expected " + (self.$actual().$inspect()) + " not to " + (self.$name_to_sentence()) + (self.$expected_to_sentence()); }; ;$opal.donate(self, ["$diffable?", "$description", "$failure_message_for_should", "$failure_message_for_should_not"]); })(self); (function($base, $super) { function $Matcher(){}; var self = $Matcher = $klass($base, $super, 'Matcher', $Matcher); var def = self.$$proto, $scope = self.$$scope, TMP_15, TMP_16, TMP_17; def.actual = nil; self.$include($scope.get('DefaultImplementations')); self.$include((($scope.get('RSpec')).$$scope.get('Matchers'))); self.$include((((($scope.get('RSpec')).$$scope.get('Matchers'))).$$scope.get('Pretty'))); self.$extend($scope.get('Macros')); self.$attr_reader("expected", "actual", "rescued_exception"); self.$attr_accessor("matcher_execution_context"); def.$initialize = function(name, declarations, expected) { var $a, $b, self = this; expected = $slice.call(arguments, 2); self.name = name; self.actual = nil; self.expected = expected; return ($a = ($b = (function(self) { var $scope = self.$$scope, def = self.$$proto; self.$include(self.user_method_defs = $scope.get('Module').$new()); return self; })(self.$singleton_class())).$class_exec, $a.$$p = declarations.$to_proc(), $a).apply($b, [].concat(expected)); }; def.$inspect = function() { var self = this; return "#<" + (self.$class().$name()) + " " + (self.$name()) + ">"; }; if ($scope.get('RUBY_VERSION').$to_f()['$>='](1.9)) { def['$respond_to_missing?'] = TMP_15 = function(method, include_private) {var $zuper = $slice.call(arguments, 0); var $a, self = this, $iter = TMP_15.$$p, $yield = $iter || nil; if (include_private == null) { include_private = false } TMP_15.$$p = null; return ((($a = $opal.find_super_dispatcher(self, 'respond_to_missing?', TMP_15, $iter).apply(self, $zuper)) !== false && $a !== nil) ? $a : self.$matcher_execution_context()['$respond_to?'](method, include_private)); } } else { def['$respond_to?'] = TMP_16 = function(method, include_private) {var $zuper = $slice.call(arguments, 0); var $a, self = this, $iter = TMP_16.$$p, $yield = $iter || nil; if (include_private == null) { include_private = false } TMP_16.$$p = null; return ((($a = $opal.find_super_dispatcher(self, 'respond_to?', TMP_16, $iter).apply(self, $zuper)) !== false && $a !== nil) ? $a : self.$matcher_execution_context()['$respond_to?'](method, include_private)); } }; self.$private(); def.$actual_arg_for = function(block) { var $a, self = this; if ((($a = block.$arity()['$zero?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return [] } else { return [self.actual] }; }; return (def.$method_missing = TMP_17 = function(method, args) { var $a, $b, self = this, $iter = TMP_17.$$p, block = $iter || nil; args = $slice.call(arguments, 1); TMP_17.$$p = null; if ((($a = self.$matcher_execution_context()['$respond_to?'](method)) !== nil && (!$a.$$is_boolean || $a == true))) { return ($a = ($b = self.$matcher_execution_context()).$__send__, $a.$$p = block.$to_proc(), $a).apply($b, [method].concat(args)) } else { return $opal.find_super_dispatcher(self, 'method_missing', TMP_17, null).apply(self, [method].concat(args).concat(block.$to_proc())) }; }, nil) && 'method_missing'; })(self, null); })(self) })(self) })(self); }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/matchers/method_missing"] = 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(['$private', '$=~', '$to_s', '$new', '$to_proc']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Matchers'); var def = self.$$proto, $scope = self.$$scope, TMP_1; self.$private(); def.$method_missing = TMP_1 = function(method, args) {var $zuper = $slice.call(arguments, 0); var $a, $b, $c, self = this, $iter = TMP_1.$$p, block = $iter || nil; args = $slice.call(arguments, 1); TMP_1.$$p = null; if ((($a = method.$to_s()['$=~'](/^be_/)) !== nil && (!$a.$$is_boolean || $a == true))) { return ($a = ($b = (((($scope.get('Matchers')).$$scope.get('BuiltIn'))).$$scope.get('BePredicate'))).$new, $a.$$p = block.$to_proc(), $a).apply($b, [method].concat(args))}; if ((($a = method.$to_s()['$=~'](/^have_/)) !== nil && (!$a.$$is_boolean || $a == true))) { return ($a = ($c = (((($scope.get('Matchers')).$$scope.get('BuiltIn'))).$$scope.get('Has'))).$new, $a.$$p = block.$to_proc(), $a).apply($c, [method].concat(args))}; return $opal.find_super_dispatcher(self, 'method_missing', TMP_1, $iter).apply(self, $zuper); }; ;$opal.donate(self, ["$method_missing"]); })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/matchers/operator_matcher"] = 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(['$registry', '$[]', '$[]=', '$delete', '$each', '$ancestors', '$define_method', '$uses_generic_implementation_of?', '$get', '$class', '$__send__', '$last_should', '$new', '$eval_match', '$sub', '$!', '$==', '$respond_to?', '$raise', '$+', '$use_custom_matcher_or_delegate', '$fail_with', '$inspect', '$private', '$owner', '$method_handle_for', '$last_matcher=', '$__delegate_operator', '$include?', '$fail_with_message', '$gsub']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Matchers'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $OperatorMatcher(){}; var self = $OperatorMatcher = $klass($base, $super, 'OperatorMatcher', $OperatorMatcher); var def = self.$$proto, $scope = self.$$scope, $a, $b, TMP_4; def.expected = def.actual = def.operator = nil; (function(self) { var $scope = self.$$scope, def = self.$$proto; self.$$proto.$registry = function() { var $a, self = this; if (self.registry == null) self.registry = nil; return ((($a = self.registry) !== false && $a !== nil) ? $a : self.registry = $hash2([], {})); }; self.$$proto.$register = function(klass, operator, matcher) { var $a, $b, $c, self = this; ($a = klass, $b = self.$registry(), ((($c = $b['$[]']($a)) !== false && $c !== nil) ? $c : $b['$[]=']($a, $hash2([], {})))); return self.$registry()['$[]'](klass)['$[]='](operator, matcher); }; self.$$proto.$unregister = function(klass, operator) { var $a, self = this; return ($a = self.$registry()['$[]'](klass), $a !== false && $a !== nil ?self.$registry()['$[]'](klass).$delete(operator) : $a); }; return (self.$$proto.$get = function(klass, operator) {try { var $a, $b, TMP_1, self = this; ($a = ($b = klass.$ancestors()).$each, $a.$$p = (TMP_1 = function(ancestor){var self = TMP_1.$$s || this, $a, matcher = nil; if (ancestor == null) ancestor = nil; matcher = ($a = self.$registry()['$[]'](ancestor), $a !== false && $a !== nil ?self.$registry()['$[]'](ancestor)['$[]'](operator) : $a); if (matcher !== false && matcher !== nil) { $opal.$return(matcher) } else { return nil };}, TMP_1.$$s = self, TMP_1), $a).call($b); return nil; } catch ($returner) { if ($returner === $opal.returner) { return $returner.$v } throw $returner; } }, nil) && 'get'; })(self.$singleton_class()); def.$initialize = function(actual) { var self = this; return self.actual = actual; }; $opal.defs(self, '$use_custom_matcher_or_delegate', function(operator) { var $a, $b, TMP_2, $c, TMP_3, self = this, negative_operator = nil; ($a = ($b = self).$define_method, $a.$$p = (TMP_2 = function(expected){var self = TMP_2.$$s || this, $a, $b, matcher = nil; if (self.actual == null) self.actual = nil; if (expected == null) expected = nil; if ((($a = ($b = self['$uses_generic_implementation_of?'](operator), $b !== false && $b !== nil ?matcher = $scope.get('OperatorMatcher').$get(self.actual.$class(), operator) : $b)) !== nil && (!$a.$$is_boolean || $a == true))) { return self.actual.$__send__(((Opal.get('RSpec')).$$scope.get('Matchers')).$last_should(), matcher.$new(expected)) } else { return self.$eval_match(self.actual, operator, expected) }}, TMP_2.$$s = self, TMP_2), $a).call($b, operator); negative_operator = operator.$sub(/^=/, "!"); if ((($a = ($c = negative_operator['$=='](operator)['$!'](), $c !== false && $c !== nil ?self['$respond_to?'](negative_operator) : $c)) !== nil && (!$a.$$is_boolean || $a == true))) { return ($a = ($c = self).$define_method, $a.$$p = (TMP_3 = function(expected){var self = TMP_3.$$s || this, opposite_should = nil; if (expected == null) expected = nil; opposite_should = (function() {if (((Opal.get('RSpec')).$$scope.get('Matchers')).$last_should()['$==']("should")) { return "should_not" } else { return "should" }; return nil; })(); return self.$raise(((((("RSpec does not support `") + (((Opal.get('RSpec')).$$scope.get('Matchers')).$last_should())) + " ") + (negative_operator)) + " expected`. ")['$+']("Use `" + (opposite_should) + " " + (operator) + " expected` instead."));}, TMP_3.$$s = self, TMP_3), $a).call($c, negative_operator) } else { return nil }; }); ($a = ($b = ["==", "===", "=~", ">", ">=", "<", "<="]).$each, $a.$$p = (TMP_4 = function(operator){var self = TMP_4.$$s || this; if (operator == null) operator = nil; return self.$use_custom_matcher_or_delegate(operator)}, TMP_4.$$s = self, TMP_4), $a).call($b); def.$fail_with_message = function(message) { var self = this; return (($scope.get('RSpec')).$$scope.get('Expectations')).$fail_with(message, self.expected, self.actual); }; def.$description = function() { var self = this; return "" + (self.operator) + " " + (self.expected.$inspect()); }; self.$private(); def['$uses_generic_implementation_of?'] = function(op) { var self = this; try { return $scope.get('Expectations').$method_handle_for(self.actual, op).$owner()['$=='](Opal.get('Kernel')) } catch ($err) {if ($opal.$rescue($err, [$scope.get('NameError')])) { return false }else { throw $err; } }; }; return (def.$eval_match = function(actual, operator, expected) { var $a, $b, self = this; (($a = [self]), $b = ((Opal.get('RSpec')).$$scope.get('Matchers')), $b['$last_matcher='].apply($b, $a), $a[$a.length-1]); $a = [operator, expected], self.operator = $a[0], self.expected = $a[1]; return self.$__delegate_operator(actual, operator, expected); }, nil) && 'eval_match'; })(self, null); (function($base) { var self = $module($base, 'BuiltIn'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $PositiveOperatorMatcher(){}; var self = $PositiveOperatorMatcher = $klass($base, $super, 'PositiveOperatorMatcher', $PositiveOperatorMatcher); var def = self.$$proto, $scope = self.$$scope; return (def.$__delegate_operator = function(actual, operator, expected) { var $a, self = this; if ((($a = actual.$__send__(operator, expected)) !== nil && (!$a.$$is_boolean || $a == true))) { return true } else if ((($a = ["==", "===", "=~"]['$include?'](operator)) !== nil && (!$a.$$is_boolean || $a == true))) { return self.$fail_with_message("expected: " + (expected.$inspect()) + "\n got: " + (actual.$inspect()) + " (using " + (operator) + ")") } else { return self.$fail_with_message("expected: " + (operator) + " " + (expected.$inspect()) + "\n got: " + (operator.$gsub(/./, " ")) + " " + (actual.$inspect())) }; }, nil) && '__delegate_operator' })(self, $scope.get('OperatorMatcher')); (function($base, $super) { function $NegativeOperatorMatcher(){}; var self = $NegativeOperatorMatcher = $klass($base, $super, 'NegativeOperatorMatcher', $NegativeOperatorMatcher); var def = self.$$proto, $scope = self.$$scope; return (def.$__delegate_operator = function(actual, operator, expected) { var $a, self = this; if ((($a = actual.$__send__(operator, expected)) !== nil && (!$a.$$is_boolean || $a == true))) { } else { return false }; return self.$fail_with_message("expected not: " + (operator) + " " + (expected.$inspect()) + "\n got: " + (operator.$gsub(/./, " ")) + " " + (actual.$inspect())); }, nil) && '__delegate_operator' })(self, $scope.get('OperatorMatcher')); })(self); })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/matchers/pretty"] = 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, $range = $opal.range; $opal.add_stubs(['$gsub', '$to_s', '$map', '$to_word', '$Array', '$length', '$===', '$[]', '$join', '$each_with_index', '$<', '$-', '$<<', '$inspect', '$is_matcher_with_description?', '$description', '$split_words', '$name', '$to_sentence', '$underscore', '$last', '$split', '$class', '$dup', '$gsub!', '$tr!', '$downcase!', '$private', '$is_a_matcher?', '$respond_to?']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Matchers'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Pretty'); var def = self.$$proto, $scope = self.$$scope; def.$split_words = function(sym) { var self = this; return sym.$to_s().$gsub(/_/, " "); }; def.$to_sentence = function(words) { var $a, $b, TMP_1, self = this, $case = nil; if (words !== false && words !== nil) { } else { return "" }; words = ($a = ($b = self.$Array(words)).$map, $a.$$p = (TMP_1 = function(w){var self = TMP_1.$$s || this; if (w == null) w = nil; return self.$to_word(w)}, TMP_1.$$s = self, TMP_1), $a).call($b); return (function() {$case = words.$length();if ((0)['$===']($case)) {return ""}else if ((1)['$===']($case)) {return " " + (words['$[]'](0))}else if ((2)['$===']($case)) {return " " + (words['$[]'](0)) + " and " + (words['$[]'](1))}else {return " " + (words['$[]']($range(0, -1, true)).$join(", ")) + ", and " + (words['$[]'](-1))}})(); }; def.$_pretty_print = function(array) { var $a, $b, TMP_2, self = this, result = nil; result = ""; ($a = ($b = array).$each_with_index, $a.$$p = (TMP_2 = function(item, index){var self = TMP_2.$$s || this; if (item == null) item = nil;if (index == null) index = nil; if (index['$<']((array.$length()['$-'](2)))) { return result['$<<']("" + (item.$inspect()) + ", ") } else if (index['$<']((array.$length()['$-'](1)))) { return result['$<<']("" + (item.$inspect()) + " and ") } else { return result['$<<']("" + (item.$inspect())) }}, TMP_2.$$s = self, TMP_2), $a).call($b); return result; }; def.$to_word = function(item) { var $a, self = this; if ((($a = self['$is_matcher_with_description?'](item)) !== nil && (!$a.$$is_boolean || $a == true))) { return item.$description() } else { return item.$inspect() }; }; def.$name_to_sentence = function() { var self = this; return self.$split_words(self.$name()); }; def.$expected_to_sentence = function() { var $a, $b, self = this; if (self.expected == null) self.expected = nil; if ((($a = (($b = self['expected'], $b != null && $b !== nil) ? 'instance-variable' : nil)) !== nil && (!$a.$$is_boolean || $a == true))) { return self.$to_sentence(self.expected) } else { return nil }; }; def.$name = function() { var $a, $b, self = this; if (self.name == null) self.name = nil; if ((($a = (($b = self['name'], $b != null && $b !== nil) ? 'instance-variable' : nil)) !== nil && (!$a.$$is_boolean || $a == true))) { return self.name } else { return self.$underscore(self.$class().$name().$split("::").$last()) }; }; def.$underscore = function(camel_cased_word) { var self = this, word = nil; word = camel_cased_word.$to_s().$dup(); 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; }; self.$private(); def['$is_matcher_with_description?'] = function(object) { var $a, self = this; return ($a = (($scope.get('RSpec')).$$scope.get('Matchers'))['$is_a_matcher?'](object), $a !== false && $a !== nil ?object['$respond_to?']("description") : $a); }; ;$opal.donate(self, ["$split_words", "$to_sentence", "$_pretty_print", "$to_word", "$name_to_sentence", "$expected_to_sentence", "$name", "$underscore", "$is_matcher_with_description?"]); })(self) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/matchers/test_unit_integration"] = function($opal) { $opal.dynamic_require_severity = "warning"; var $a, self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice; $opal.add_stubs(['$send']); if ((($a = (function(){ try { return (((((($scope.get('MiniTest')).$$scope.get('Unit'))).$$scope.get('TestCase'))) != null ? 'constant' : nil); } catch (err) { if (err.$$class === Opal.NameError) { return nil; } else { throw(err); }}; })()) !== nil && (!$a.$$is_boolean || $a == true))) { (((($scope.get('MiniTest')).$$scope.get('Unit'))).$$scope.get('TestCase')).$send("include", (($scope.get('RSpec')).$$scope.get('Matchers')))}; if ((($a = (function(){ try { return (((((($scope.get('Test')).$$scope.get('Unit'))).$$scope.get('TestCase'))) != null ? 'constant' : nil); } catch (err) { if (err.$$class === Opal.NameError) { return nil; } else { throw(err); }}; })()) !== nil && (!$a.$$is_boolean || $a == true))) { return (((($scope.get('Test')).$$scope.get('Unit'))).$$scope.get('TestCase')).$send("include", (($scope.get('RSpec')).$$scope.get('Matchers'))) } else { return nil }; }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/matchers"] = 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, $range = $opal.range; $opal.add_stubs(['$require', '$===', '$respond_to?', '$new', '$alias_method', '$empty?', '$equal', '$be_a_kind_of', '$to_proc', '$register']); self.$require("rspec/matchers/pretty"); self.$require("rspec/matchers/built_in"); self.$require("rspec/matchers/matcher"); self.$require("rspec/matchers/operator_matcher"); self.$require("rspec/matchers/generated_descriptions"); self.$require("rspec/matchers/method_missing"); self.$require("rspec/matchers/compatibility"); self.$require("rspec/matchers/dsl"); self.$require("rspec/matchers/test_unit_integration"); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Matchers'); var def = self.$$proto, $scope = self.$$scope, TMP_1, $a, TMP_2, TMP_3; $opal.defs(self, '$is_a_matcher?', function(obj) { var $a, self = this; if ((($a = ((((((Opal.get('RSpec')).$$scope.get('Matchers'))).$$scope.get('BuiltIn'))).$$scope.get('BaseMatcher'))['$==='](obj)) !== nil && (!$a.$$is_boolean || $a == true))) { return true}; if ((($a = obj['$respond_to?']("i_respond_to_everything_so_im_not_really_a_matcher")) !== nil && (!$a.$$is_boolean || $a == true))) { return false}; if ((($a = obj['$respond_to?']("matches?")) !== nil && (!$a.$$is_boolean || $a == true))) { } else { return false }; return ((($a = obj['$respond_to?']("failure_message_for_should")) !== false && $a !== nil) ? $a : obj['$respond_to?']("failure_message")); }); def.$be_truthy = function() { var self = this; return (($scope.get('BuiltIn')).$$scope.get('BeTruthy')).$new(); }; def.$be_falsey = function() { var self = this; return (($scope.get('BuiltIn')).$$scope.get('BeFalsey')).$new(); }; self.$alias_method("be_falsy", "be_falsey"); def.$be_nil = function() { var self = this; return (($scope.get('BuiltIn')).$$scope.get('BeNil')).$new(); }; def.$be = function(args) { var $a, self = this; args = $slice.call(arguments, 0); if ((($a = args['$empty?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return (((($scope.get('Matchers')).$$scope.get('BuiltIn'))).$$scope.get('Be')).$new() } else { return ($a = self).$equal.apply($a, [].concat(args)) }; }; def.$be_a = function(klass) { var self = this; return self.$be_a_kind_of(klass); }; self.$alias_method("be_an", "be_a"); def.$be_an_instance_of = function(expected) { var self = this; return (($scope.get('BuiltIn')).$$scope.get('BeAnInstanceOf')).$new(expected); }; self.$alias_method("be_instance_of", "be_an_instance_of"); def.$be_a_kind_of = function(expected) { var self = this; return (($scope.get('BuiltIn')).$$scope.get('BeAKindOf')).$new(expected); }; self.$alias_method("be_kind_of", "be_a_kind_of"); def.$be_within = function(delta) { var self = this; return (($scope.get('BuiltIn')).$$scope.get('BeWithin')).$new(delta); }; def.$change = TMP_1 = function(receiver, message) { var $a, $b, self = this, $iter = TMP_1.$$p, block = $iter || nil; if (receiver == null) { receiver = nil } if (message == null) { message = nil } TMP_1.$$p = null; return ($a = ($b = (($scope.get('BuiltIn')).$$scope.get('Change'))).$new, $a.$$p = block.$to_proc(), $a).call($b, receiver, message); }; if ((($a = ($range(1, 2, false))['$respond_to?']("cover?")) !== nil && (!$a.$$is_boolean || $a == true))) { def.$cover = function(values) { var $a, self = this; values = $slice.call(arguments, 0); return ($a = (($scope.get('BuiltIn')).$$scope.get('Cover'))).$new.apply($a, [].concat(values)); }}; def.$end_with = function(expected) { var $a, self = this; expected = $slice.call(arguments, 0); return ($a = (($scope.get('BuiltIn')).$$scope.get('EndWith'))).$new.apply($a, [].concat(expected)); }; def.$eq = function(expected) { var self = this; return (($scope.get('BuiltIn')).$$scope.get('Eq')).$new(expected); }; def.$eql = function(expected) { var self = this; return (($scope.get('BuiltIn')).$$scope.get('Eql')).$new(expected); }; def.$equal = function(expected) { var self = this; return (($scope.get('BuiltIn')).$$scope.get('Equal')).$new(expected); }; def.$exist = function(args) { var $a, self = this; args = $slice.call(arguments, 0); return ($a = (($scope.get('BuiltIn')).$$scope.get('Exist'))).$new.apply($a, [].concat(args)); }; def.$include = function(expected) { var $a, self = this; expected = $slice.call(arguments, 0); return ($a = (($scope.get('BuiltIn')).$$scope.get('Include'))).$new.apply($a, [].concat(expected)); }; def.$match = function(expected) { var self = this; return (($scope.get('BuiltIn')).$$scope.get('Match')).$new(expected); }; self.$alias_method("match_regex", "match"); def.$raise_error = TMP_2 = function(error, message) { var $a, $b, self = this, $iter = TMP_2.$$p, block = $iter || nil; if (error == null) { error = $scope.get('Exception') } if (message == null) { message = nil } TMP_2.$$p = null; return ($a = ($b = (($scope.get('BuiltIn')).$$scope.get('RaiseError'))).$new, $a.$$p = block.$to_proc(), $a).call($b, error, message); }; self.$alias_method("raise_exception", "raise_error"); def.$respond_to = function(names) { var $a, self = this; names = $slice.call(arguments, 0); return ($a = (($scope.get('BuiltIn')).$$scope.get('RespondTo'))).$new.apply($a, [].concat(names)); }; def.$satisfy = TMP_3 = function() { var $a, $b, self = this, $iter = TMP_3.$$p, block = $iter || nil; TMP_3.$$p = null; return ($a = ($b = (($scope.get('BuiltIn')).$$scope.get('Satisfy'))).$new, $a.$$p = block.$to_proc(), $a).call($b); }; def.$start_with = function(expected) { var $a, self = this; expected = $slice.call(arguments, 0); return ($a = (($scope.get('BuiltIn')).$$scope.get('StartWith'))).$new.apply($a, [].concat(expected)); }; def.$throw_symbol = function(expected_symbol, expected_arg) { var self = this; if (expected_symbol == null) { expected_symbol = nil } if (expected_arg == null) { expected_arg = nil } return (($scope.get('BuiltIn')).$$scope.get('ThrowSymbol')).$new(expected_symbol, expected_arg); }; def.$yield_control = function() { var self = this; return (($scope.get('BuiltIn')).$$scope.get('YieldControl')).$new(); }; def.$yield_with_no_args = function() { var self = this; return (($scope.get('BuiltIn')).$$scope.get('YieldWithNoArgs')).$new(); }; def.$yield_with_args = function(args) { var $a, self = this; args = $slice.call(arguments, 0); return ($a = (($scope.get('BuiltIn')).$$scope.get('YieldWithArgs'))).$new.apply($a, [].concat(args)); }; def.$yield_successive_args = function(args) { var $a, self = this; args = $slice.call(arguments, 0); return ($a = (($scope.get('BuiltIn')).$$scope.get('YieldSuccessiveArgs'))).$new.apply($a, [].concat(args)); }; def.$match_array = function(array) { var self = this; return (($scope.get('BuiltIn')).$$scope.get('MatchArray')).$new(array); }; $scope.get('OperatorMatcher').$register($scope.get('Enumerable'), "=~", (($scope.get('BuiltIn')).$$scope.get('MatchArray'))); ;$opal.donate(self, ["$be_truthy", "$be_falsey", "$be_nil", "$be", "$be_a", "$be_an_instance_of", "$be_a_kind_of", "$be_within", "$change", "$cover", "$end_with", "$eq", "$eql", "$equal", "$exist", "$include", "$match", "$raise_error", "$respond_to", "$satisfy", "$start_with", "$throw_symbol", "$yield_control", "$yield_with_no_args", "$yield_with_args", "$yield_successive_args", "$match_array"]); })(self) })(self); }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec-expectations"] = 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']); return self.$require("rspec/expectations") }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/mocks/any_instance/chain"] = 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(['$define_method', '$record', '$to_proc', '$include', '$create_message_expectation_on', '$inject', '$__send__', '$last', '$first', '$messages', '$any?', '$==', '$negated?', '$raise_double_negation_error', '$private', '$empty?', '$verify_invocation_order', '$<<', '$unshift']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Mocks'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'AnyInstance'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Chain(){}; var self = $Chain = $klass($base, $super, 'Chain', $Chain); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_6, TMP_8; def.messages = nil; def.$initialize = TMP_1 = function(recorder, args) { var self = this, $iter = TMP_1.$$p, block = $iter || nil; args = $slice.call(arguments, 1); TMP_1.$$p = null; self.recorder = recorder; self.expectation_args = args; return self.expectation_block = block; }; (function($base) { var self = $module($base, 'Customizations'); var def = self.$$proto, $scope = self.$$scope; $opal.defs(self, '$record', function(method_name) { var $a, $b, TMP_2, self = this; return ($a = ($b = self).$define_method, $a.$$p = (TMP_2 = function(args){var self = TMP_2.$$s || this, block, $a, $b; args = $slice.call(arguments, 0); block = TMP_2.$$p || nil, TMP_2.$$p = null; return ($a = ($b = self).$record, $a.$$p = block.$to_proc(), $a).apply($b, [method_name].concat(args))}, TMP_2.$$s = self, TMP_2), $a).call($b, method_name); }); self.$record("and_return"); self.$record("and_raise"); self.$record("and_throw"); self.$record("and_yield"); self.$record("and_call_original"); self.$record("with"); self.$record("once"); self.$record("twice"); self.$record("any_number_of_times"); self.$record("exactly"); self.$record("times"); self.$record("never"); self.$record("at_least"); self.$record("at_most"); })(self); self.$include($scope.get('Customizations')); def['$playback!'] = function(instance) { var $a, $b, TMP_3, self = this, message_expectation = nil; message_expectation = self.$create_message_expectation_on(instance); return ($a = ($b = self.$messages()).$inject, $a.$$p = (TMP_3 = function(object, message){var self = TMP_3.$$s || this, $a, $b; if (object == null) object = nil;if (message == null) message = nil; return ($a = ($b = object).$__send__, $a.$$p = message.$last().$to_proc(), $a).apply($b, [].concat(message.$first()))}, TMP_3.$$s = self, TMP_3), $a).call($b, message_expectation); }; def['$constrained_to_any_of?'] = function(constraints) { var $a, $b, TMP_4, self = this; constraints = $slice.call(arguments, 0); return ($a = ($b = constraints)['$any?'], $a.$$p = (TMP_4 = function(constraint){var self = TMP_4.$$s || this, $a, $b, TMP_5; if (constraint == null) constraint = nil; return ($a = ($b = self.$messages())['$any?'], $a.$$p = (TMP_5 = function(message){var self = TMP_5.$$s || this; if (message == null) message = nil; return message.$first().$first()['$=='](constraint)}, TMP_5.$$s = self, TMP_5), $a).call($b)}, TMP_4.$$s = self, TMP_4), $a).call($b); }; def['$expectation_fulfilled!'] = function() { var self = this; return self.expectation_fulfilled = true; }; def.$never = TMP_6 = function() {var $zuper = $slice.call(arguments, 0); var $a, self = this, $iter = TMP_6.$$p, $yield = $iter || nil; TMP_6.$$p = null; if ((($a = self['$negated?']()) !== nil && (!$a.$$is_boolean || $a == true))) { $scope.get('ErrorGenerator').$raise_double_negation_error("expect_any_instance_of(MyClass)")}; return $opal.find_super_dispatcher(self, 'never', TMP_6, $iter).apply(self, $zuper); }; self.$private(); def['$negated?'] = function() { var $a, $b, TMP_7, self = this; return ($a = ($b = self.$messages())['$any?'], $a.$$p = (TMP_7 = function($c, _){var self = TMP_7.$$s || this; message = $c[0];if (_ == null) _ = nil; return message['$==']("never")}, TMP_7.$$s = self, TMP_7), $a).call($b); }; def.$messages = function() { var $a, self = this; return ((($a = self.messages) !== false && $a !== nil) ? $a : self.messages = []); }; def.$last_message = function() { var $a, self = this; if ((($a = self.$messages()['$empty?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return nil } else { return self.$messages().$last().$first().$first() }; }; return (def.$record = TMP_8 = function(rspec_method_name, args) { var $a, $b, self = this, $iter = TMP_8.$$p, block = $iter || nil; args = $slice.call(arguments, 1); TMP_8.$$p = null; ($a = ($b = self).$verify_invocation_order, $a.$$p = block.$to_proc(), $a).apply($b, [rspec_method_name].concat(args)); self.$messages()['$<<']([args.$unshift(rspec_method_name), block]); return self; }, nil) && 'record'; })(self, null) })(self) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/mocks/any_instance/expectation_chain"] = 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(['$constrained_to_any_of?', '$private', '$proxy_for', '$add_message_expectation', '$to_proc', '$yield_receiver_to_any_instance_implementation_blocks?', '$configuration', '$and_yield_receiver_to_implementation']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Mocks'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'AnyInstance'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $ExpectationChain(){}; var self = $ExpectationChain = $klass($base, $super, 'ExpectationChain', $ExpectationChain); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2; def.expectation_fulfilled = nil; def['$expectation_fulfilled?'] = function() { var $a, self = this; return ((($a = self.expectation_fulfilled) !== false && $a !== nil) ? $a : self['$constrained_to_any_of?']("never", "any_number_of_times")); }; def.$initialize = TMP_1 = function(args) {var $zuper = $slice.call(arguments, 0); var self = this, $iter = TMP_1.$$p, block = $iter || nil; args = $slice.call(arguments, 0); TMP_1.$$p = null; self.expectation_fulfilled = false; return $opal.find_super_dispatcher(self, 'initialize', TMP_1, $iter).apply(self, $zuper); }; self.$private(); return (def.$verify_invocation_order = TMP_2 = function(rspec_method_name, args) { var self = this, $iter = TMP_2.$$p, block = $iter || nil; args = $slice.call(arguments, 1); TMP_2.$$p = null; return nil; }, nil) && 'verify_invocation_order'; })(self, $scope.get('Chain')); (function($base, $super) { function $PositiveExpectationChain(){}; var self = $PositiveExpectationChain = $klass($base, $super, 'PositiveExpectationChain', $PositiveExpectationChain); var def = self.$$proto, $scope = self.$$scope; def.expectation_block = def.expectation_args = def.invocation_order = nil; self.$private(); def.$create_message_expectation_on = function(instance) { var $a, $b, self = this, proxy = nil, expected_from = nil, me = nil; proxy = ((Opal.get('RSpec')).$$scope.get('Mocks')).$proxy_for(instance); expected_from = $scope.get('IGNORED_BACKTRACE_LINE'); me = ($a = ($b = proxy).$add_message_expectation, $a.$$p = self.expectation_block.$to_proc(), $a).apply($b, [expected_from].concat(self.expectation_args)); if ((($a = (($scope.get('RSpec')).$$scope.get('Mocks')).$configuration()['$yield_receiver_to_any_instance_implementation_blocks?']()) !== nil && (!$a.$$is_boolean || $a == true))) { me.$and_yield_receiver_to_implementation()}; return me; }; return (def.$invocation_order = function() { var $a, self = this; return ((($a = self.invocation_order) !== false && $a !== nil) ? $a : self.invocation_order = $hash2(["with", "and_return", "and_raise"], {"with": [nil], "and_return": ["with", nil], "and_raise": ["with", nil]})); }, nil) && 'invocation_order'; })(self, $scope.get('ExpectationChain')); })(self) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/mocks/any_instance/message_chains"] = 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(['$new', '$[]=', '$[]', '$<<', '$reject!', '$===', '$find', '$all?', '$expectation_fulfilled?', '$compact', '$map', '$last', '$to_s', '$each', '$expectation_fulfilled!', '$raise_if_second_instance_to_receive_message', '$playback!', '$private', '$!', '$equal?', '$raise', '$join', '$sort', '$unfulfilled_expectations']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Mocks'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'AnyInstance'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $MessageChains(){}; var self = $MessageChains = $klass($base, $super, 'MessageChains', $MessageChains); var def = self.$$proto, $scope = self.$$scope; def.chains_by_method_name = def.instance_with_expectation = nil; def.$initialize = function() { var $a, $b, TMP_1, self = this; return self.chains_by_method_name = ($a = ($b = $scope.get('Hash')).$new, $a.$$p = (TMP_1 = function(h, k){var self = TMP_1.$$s || this; if (h == null) h = nil;if (k == null) k = nil; return h['$[]='](k, [])}, TMP_1.$$s = self, TMP_1), $a).call($b); }; def['$[]'] = function(method_name) { var self = this; return self.chains_by_method_name['$[]'](method_name); }; def.$add = function(method_name, chain) { var self = this; self.chains_by_method_name['$[]'](method_name)['$<<'](chain); return chain; }; def['$remove_stub_chains_for!'] = function(method_name) { var $a, $b, TMP_2, self = this; return ($a = ($b = self.chains_by_method_name['$[]'](method_name))['$reject!'], $a.$$p = (TMP_2 = function(chain){var self = TMP_2.$$s || this; if (chain == null) chain = nil; return $scope.get('StubChain')['$==='](chain)}, TMP_2.$$s = self, TMP_2), $a).call($b); }; def['$has_expectation?'] = function(method_name) { var $a, $b, TMP_3, self = this; return ($a = ($b = self.chains_by_method_name['$[]'](method_name)).$find, $a.$$p = (TMP_3 = function(chain){var self = TMP_3.$$s || this; if (chain == null) chain = nil; return $scope.get('ExpectationChain')['$==='](chain)}, TMP_3.$$s = self, TMP_3), $a).call($b); }; def['$all_expectations_fulfilled?'] = function() { var $a, $b, TMP_4, self = this; return ($a = ($b = self.chains_by_method_name)['$all?'], $a.$$p = (TMP_4 = function(method_name, chains){var self = TMP_4.$$s || this, $a, $b, TMP_5; if (method_name == null) method_name = nil;if (chains == null) chains = nil; return ($a = ($b = chains)['$all?'], $a.$$p = (TMP_5 = function(chain){var self = TMP_5.$$s || this; if (chain == null) chain = nil; return chain['$expectation_fulfilled?']()}, TMP_5.$$s = self, TMP_5), $a).call($b)}, TMP_4.$$s = self, TMP_4), $a).call($b); }; def.$unfulfilled_expectations = function() { var $a, $b, TMP_6, self = this; return ($a = ($b = self.chains_by_method_name).$map, $a.$$p = (TMP_6 = function(method_name, chains){var self = TMP_6.$$s || this, $a; if (method_name == null) method_name = nil;if (chains == null) chains = nil; if ((($a = chains.$last()['$expectation_fulfilled?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return nil } else if ((($a = $scope.get('ExpectationChain')['$==='](chains.$last())) !== nil && (!$a.$$is_boolean || $a == true))) { return method_name.$to_s() } else { return nil }}, TMP_6.$$s = self, TMP_6), $a).call($b).$compact(); }; def['$received_expected_message!'] = function(method_name) { var $a, $b, TMP_7, self = this; return ($a = ($b = self.chains_by_method_name['$[]'](method_name)).$each, $a.$$p = (TMP_7 = function(chain){var self = TMP_7.$$s || this; if (chain == null) chain = nil; return chain['$expectation_fulfilled!']()}, TMP_7.$$s = self, TMP_7), $a).call($b); }; def['$playback!'] = function(instance, method_name) { var $a, $b, TMP_8, self = this; self.$raise_if_second_instance_to_receive_message(instance); return ($a = ($b = self.chains_by_method_name['$[]'](method_name)).$each, $a.$$p = (TMP_8 = function(chain){var self = TMP_8.$$s || this; if (chain == null) chain = nil; return chain['$playback!'](instance)}, TMP_8.$$s = self, TMP_8), $a).call($b); }; self.$private(); return (def.$raise_if_second_instance_to_receive_message = function(instance) { var $a, $b, self = this; if ((($a = $scope.get('ExpectationChain')['$==='](instance)) !== nil && (!$a.$$is_boolean || $a == true))) { ((($a = self.instance_with_expectation) !== false && $a !== nil) ? $a : self.instance_with_expectation = instance)}; if ((($a = ($b = $scope.get('ExpectationChain')['$==='](instance), $b !== false && $b !== nil ?self.instance_with_expectation['$equal?'](instance)['$!']() : $b)) !== nil && (!$a.$$is_boolean || $a == true))) { return self.$raise((((($scope.get('RSpec')).$$scope.get('Mocks'))).$$scope.get('MockExpectationError')), "Exactly one instance should have received the following message(s) but didn't: " + (self.$unfulfilled_expectations().$sort().$join(", "))) } else { return nil }; }, nil) && 'raise_if_second_instance_to_receive_message'; })(self, null) })(self) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/mocks/any_instance/recorder"] = 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(['$attr_reader', '$new', '$[]=', '$===', '$each', '$and_return', '$stub', '$observe!', '$add', '$message_chains', '$to_proc', '$normalize_chain', '$never', '$should_receive', '$include?', '$to_sym', '$raise', '$remove_stub_chains_for!', '$remove_single_stub', '$[]', '$stubs', '$proxies_of', '$clear', '$has_expectation?', '$stop_observing!', '$!', '$all_expectations_fulfilled?', '$join', '$sort', '$unfulfilled_expectations', '$stop_all_observation!', '$remove_any_instance_recorder_for', '$space', '$restore_method!', '$ensure_registered', '$playback!', '$received_expected_message!', '$private', '$unshift', '$reverse', '$map', '$split', '$to_s', '$shift', '$first', '$mark_invoked!', '$public_protected_or_private_method_defined?', '$build_alias_method_name', '$restore_original_method!', '$remove_dummy_method!', '$class_exec', '$remove_method', '$alias_method', '$method_defined?', '$private_method_defined?', '$delete', '$verify_partial_doubles?', '$configuration', '$already_observing?', '$<<', '$backup_method!', '$__send__', '$owner', '$method_handle_for', '$any_instance_recorder_for', '$instance_that_received', '$inspect']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Mocks'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'AnyInstance'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Recorder(){}; var self = $Recorder = $klass($base, $super, 'Recorder', $Recorder); var def = self.$$proto, $scope = self.$$scope, TMP_2, TMP_4, TMP_6, TMP_7, TMP_13; def.observed_methods = def.klass = def.expectation_set = def.played_methods = nil; self.$attr_reader("message_chains", "stubs", "klass"); def.$initialize = function(klass) { var $a, $b, TMP_1, self = this; self.message_chains = $scope.get('MessageChains').$new(); self.stubs = ($a = ($b = $scope.get('Hash')).$new, $a.$$p = (TMP_1 = function(hash, key){var self = TMP_1.$$s || this; if (hash == null) hash = nil;if (key == null) key = nil; return hash['$[]='](key, [])}, TMP_1.$$s = self, TMP_1), $a).call($b); self.observed_methods = []; self.played_methods = $hash2([], {}); self.klass = klass; return self.expectation_set = false; }; def.$stub = TMP_2 = function(method_name_or_method_map) { var $a, $b, TMP_3, $c, self = this, $iter = TMP_2.$$p, block = $iter || nil; TMP_2.$$p = null; if ((($a = $scope.get('Hash')['$==='](method_name_or_method_map)) !== nil && (!$a.$$is_boolean || $a == true))) { return ($a = ($b = method_name_or_method_map).$each, $a.$$p = (TMP_3 = function(method_name, return_value){var self = TMP_3.$$s || this; if (method_name == null) method_name = nil;if (return_value == null) return_value = nil; return self.$stub(method_name).$and_return(return_value)}, TMP_3.$$s = self, TMP_3), $a).call($b) } else { self['$observe!'](method_name_or_method_map); return self.$message_chains().$add(method_name_or_method_map, ($a = ($c = $scope.get('StubChain')).$new, $a.$$p = block.$to_proc(), $a).call($c, self, method_name_or_method_map)); }; }; def.$stub_chain = TMP_4 = function(method_names_and_optional_return_values) { var $a, $b, TMP_5, self = this, $iter = TMP_4.$$p, block = $iter || nil; method_names_and_optional_return_values = $slice.call(arguments, 0); TMP_4.$$p = null; return ($a = ($b = self).$normalize_chain, $a.$$p = (TMP_5 = function(method_name, args){var self = TMP_5.$$s || this, $a, $b; if (method_name == null) method_name = nil;if (args == null) args = nil; self['$observe!'](method_name); return self.$message_chains().$add(method_name, ($a = ($b = $scope.get('StubChainChain')).$new, $a.$$p = block.$to_proc(), $a).apply($b, [self].concat(args)));}, TMP_5.$$s = self, TMP_5), $a).apply($b, [].concat(method_names_and_optional_return_values)); }; def.$should_receive = TMP_6 = function(method_name) { var $a, $b, self = this, $iter = TMP_6.$$p, block = $iter || nil; TMP_6.$$p = null; self.expectation_set = true; self['$observe!'](method_name); return self.$message_chains().$add(method_name, ($a = ($b = $scope.get('PositiveExpectationChain')).$new, $a.$$p = block.$to_proc(), $a).call($b, self, method_name)); }; def.$should_not_receive = TMP_7 = function(method_name) { var $a, $b, self = this, $iter = TMP_7.$$p, block = $iter || nil; TMP_7.$$p = null; return ($a = ($b = self).$should_receive, $a.$$p = block.$to_proc(), $a).call($b, method_name).$never(); }; def.$unstub = function(method_name) { var $a, $b, TMP_8, self = this; if ((($a = self.observed_methods['$include?'](method_name.$to_sym())) !== nil && (!$a.$$is_boolean || $a == true))) { } else { self.$raise((((($scope.get('RSpec')).$$scope.get('Mocks'))).$$scope.get('MockExpectationError')), "The method `" + (method_name) + "` was not stubbed or was already unstubbed") }; self.$message_chains()['$remove_stub_chains_for!'](method_name); ($a = ($b = ((Opal.get('RSpec')).$$scope.get('Mocks')).$proxies_of(self.klass)).$each, $a.$$p = (TMP_8 = function(proxy){var self = TMP_8.$$s || this, $a, $b, TMP_9; if (proxy == null) proxy = nil; return ($a = ($b = self.$stubs()['$[]'](method_name)).$each, $a.$$p = (TMP_9 = function(stub){var self = TMP_9.$$s || this; if (stub == null) stub = nil; return proxy.$remove_single_stub(method_name, stub)}, TMP_9.$$s = self, TMP_9), $a).call($b)}, TMP_8.$$s = self, TMP_8), $a).call($b); self.$stubs()['$[]'](method_name).$clear(); if ((($a = self.$message_chains()['$has_expectation?'](method_name)) !== nil && (!$a.$$is_boolean || $a == true))) { return nil } else { return self['$stop_observing!'](method_name) }; }; def.$verify = function() { var $a, $b, self = this; try { if ((($a = ($b = self.expectation_set, $b !== false && $b !== nil ?self.$message_chains()['$all_expectations_fulfilled?']()['$!']() : $b)) !== nil && (!$a.$$is_boolean || $a == true))) { return self.$raise((((($scope.get('RSpec')).$$scope.get('Mocks'))).$$scope.get('MockExpectationError')), "Exactly one instance should have received the following message(s) but didn't: " + (self.$message_chains().$unfulfilled_expectations().$sort().$join(", "))) } else { return nil } } finally { self['$stop_all_observation!'](); ((Opal.get('RSpec')).$$scope.get('Mocks')).$space().$remove_any_instance_recorder_for(self.klass); }; }; def['$stop_all_observation!'] = function() { var $a, $b, TMP_10, self = this; return ($a = ($b = self.observed_methods).$each, $a.$$p = (TMP_10 = function(method_name){var self = TMP_10.$$s || this; if (method_name == null) method_name = nil; return self['$restore_method!'](method_name)}, TMP_10.$$s = self, TMP_10), $a).call($b); }; def['$playback!'] = function(instance, method_name) { var $a, self = this; (($scope.get('RSpec')).$$scope.get('Mocks')).$space().$ensure_registered(instance); self.$message_chains()['$playback!'](instance, method_name); self.played_methods['$[]='](method_name, instance); if ((($a = self.$message_chains()['$has_expectation?'](method_name)) !== nil && (!$a.$$is_boolean || $a == true))) { return self['$received_expected_message!'](method_name) } else { return nil }; }; def.$instance_that_received = function(method_name) { var self = this; return self.played_methods['$[]'](method_name); }; def.$build_alias_method_name = function(method_name) { var self = this; return "__" + (method_name) + "_without_any_instance__"; }; def['$already_observing?'] = function(method_name) { var self = this; return self.observed_methods['$include?'](method_name); }; self.$private(); def.$normalize_chain = TMP_13 = function(args) { var $a, $b, TMP_11, $c, $d, TMP_12, self = this, $iter = TMP_13.$$p, $yield = $iter || nil; args = $slice.call(arguments, 0); TMP_13.$$p = null; ($a = ($b = ($c = ($d = args.$shift().$to_s().$split(".")).$map, $c.$$p = (TMP_12 = function(s){var self = TMP_12.$$s || this; if (s == null) s = nil; return s.$to_sym()}, TMP_12.$$s = self, TMP_12), $c).call($d).$reverse()).$each, $a.$$p = (TMP_11 = function(a){var self = TMP_11.$$s || this; if (a == null) a = nil; return args.$unshift(a)}, TMP_11.$$s = self, TMP_11), $a).call($b); return $a = $opal.$yieldX($yield, [args.$first(), args]), $a === $breaker ? $a : $a; }; def['$received_expected_message!'] = function(method_name) { var self = this; self.$message_chains()['$received_expected_message!'](method_name); self['$restore_method!'](method_name); return self['$mark_invoked!'](method_name); }; def['$restore_method!'] = function(method_name) { var $a, self = this; if ((($a = self['$public_protected_or_private_method_defined?'](self.$build_alias_method_name(method_name))) !== nil && (!$a.$$is_boolean || $a == true))) { return self['$restore_original_method!'](method_name) } else { return self['$remove_dummy_method!'](method_name) }; }; def['$restore_original_method!'] = function(method_name) { var $a, $b, TMP_14, self = this, alias_method_name = nil; alias_method_name = self.$build_alias_method_name(method_name); return ($a = ($b = self.klass).$class_exec, $a.$$p = (TMP_14 = function(){var self = TMP_14.$$s || this; self.$remove_method(method_name); self.$alias_method(method_name, alias_method_name); return self.$remove_method(alias_method_name);}, TMP_14.$$s = self, TMP_14), $a).call($b); }; def['$remove_dummy_method!'] = function(method_name) { var $a, $b, TMP_15, self = this; return ($a = ($b = self.klass).$class_exec, $a.$$p = (TMP_15 = function(){var self = TMP_15.$$s || this; return self.$remove_method(method_name)}, TMP_15.$$s = self, TMP_15), $a).call($b); }; def['$backup_method!'] = function(method_name) { var $a, $b, TMP_16, self = this, alias_method_name = nil; alias_method_name = self.$build_alias_method_name(method_name); if ((($a = self['$public_protected_or_private_method_defined?'](method_name)) !== nil && (!$a.$$is_boolean || $a == true))) { return ($a = ($b = self.klass).$class_exec, $a.$$p = (TMP_16 = function(){var self = TMP_16.$$s || this; return self.$alias_method(alias_method_name, method_name)}, TMP_16.$$s = self, TMP_16), $a).call($b) } else { return nil }; }; def['$public_protected_or_private_method_defined?'] = function(method_name) { var $a, self = this; return ((($a = self.klass['$method_defined?'](method_name)) !== false && $a !== nil) ? $a : self.klass['$private_method_defined?'](method_name)); }; def['$stop_observing!'] = function(method_name) { var self = this; self['$restore_method!'](method_name); return self.observed_methods.$delete(method_name); }; def['$observe!'] = function(method_name) { var $a, $b, TMP_17, self = this; if ((($a = (($scope.get('RSpec')).$$scope.get('Mocks')).$configuration()['$verify_partial_doubles?']()) !== nil && (!$a.$$is_boolean || $a == true))) { if ((($a = self.klass['$method_defined?'](method_name)) !== nil && (!$a.$$is_boolean || $a == true))) { } else { self.$raise($scope.get('MockExpectationError')) }}; if ((($a = self['$already_observing?'](method_name)) !== nil && (!$a.$$is_boolean || $a == true))) { self['$stop_observing!'](method_name)}; self.observed_methods['$<<'](method_name); self['$backup_method!'](method_name); return ($a = ($b = self.klass).$__send__, $a.$$p = (TMP_17 = function(args){var self = TMP_17.$$s || this, blk, $a, $b, klass = nil; args = $slice.call(arguments, 0); blk = TMP_17.$$p || nil, TMP_17.$$p = null; klass = ((Opal.get('RSpec')).$$scope.get('Mocks')).$method_handle_for(self, method_name).$owner(); ((Opal.get('RSpec')).$$scope.get('Mocks')).$any_instance_recorder_for(klass)['$playback!'](self, method_name); return ($a = ($b = self).$__send__, $a.$$p = blk.$to_proc(), $a).apply($b, [method_name].concat(args));}, TMP_17.$$s = self, TMP_17), $a).call($b, "define_method", method_name); }; return (def['$mark_invoked!'] = function(method_name) { var $a, $b, TMP_18, self = this; self['$backup_method!'](method_name); return ($a = ($b = self.klass).$__send__, $a.$$p = (TMP_18 = function(args){var self = TMP_18.$$s || this, blk, klass = nil, invoked_instance = nil; args = $slice.call(arguments, 0); blk = TMP_18.$$p || nil, TMP_18.$$p = null; klass = ((Opal.get('RSpec')).$$scope.get('Mocks')).$method_handle_for(self, method_name).$owner(); invoked_instance = ((Opal.get('RSpec')).$$scope.get('Mocks')).$any_instance_recorder_for(klass).$instance_that_received(method_name); return self.$raise((((($scope.get('RSpec')).$$scope.get('Mocks'))).$$scope.get('MockExpectationError')), "The message '" + (method_name) + "' was received by " + (self.$inspect()) + " but has already been received by " + (invoked_instance));}, TMP_18.$$s = self, TMP_18), $a).call($b, "define_method", method_name); }, nil) && 'mark_invoked!'; })(self, null) })(self) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/mocks/any_instance/stub_chain"] = 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(['$private', '$proxy_for', '$add_stub', '$to_proc', '$<<', '$[]', '$stubs', '$message', '$yield_receiver_to_any_instance_implementation_blocks?', '$configuration', '$and_yield_receiver_to_implementation', '$include?', '$invocation_order', '$last_message', '$raise']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Mocks'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'AnyInstance'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $StubChain(){}; var self = $StubChain = $klass($base, $super, 'StubChain', $StubChain); var def = self.$$proto, $scope = self.$$scope, TMP_1; def.expectation_block = def.expectation_args = def.recorder = def.invocation_order = nil; def['$expectation_fulfilled?'] = function() { var self = this; return true; }; self.$private(); def.$create_message_expectation_on = function(instance) { var $a, $b, self = this, proxy = nil, expected_from = nil, stub = nil; proxy = ((Opal.get('RSpec')).$$scope.get('Mocks')).$proxy_for(instance); expected_from = $scope.get('IGNORED_BACKTRACE_LINE'); stub = ($a = ($b = proxy).$add_stub, $a.$$p = self.expectation_block.$to_proc(), $a).apply($b, [expected_from].concat(self.expectation_args)); self.recorder.$stubs()['$[]'](stub.$message())['$<<'](stub); if ((($a = (($scope.get('RSpec')).$$scope.get('Mocks')).$configuration()['$yield_receiver_to_any_instance_implementation_blocks?']()) !== nil && (!$a.$$is_boolean || $a == true))) { stub.$and_yield_receiver_to_implementation()}; return stub; }; def.$invocation_order = function() { var $a, self = this; return ((($a = self.invocation_order) !== false && $a !== nil) ? $a : self.invocation_order = $hash2(["with", "and_return", "and_raise", "and_yield", "and_call_original"], {"with": [nil], "and_return": ["with", nil], "and_raise": ["with", nil], "and_yield": ["with", nil], "and_call_original": ["with", nil]})); }; return (def.$verify_invocation_order = TMP_1 = function(rspec_method_name, args) { var $a, self = this, $iter = TMP_1.$$p, block = $iter || nil; args = $slice.call(arguments, 1); TMP_1.$$p = null; if ((($a = self.$invocation_order()['$[]'](rspec_method_name)['$include?'](self.$last_message())) !== nil && (!$a.$$is_boolean || $a == true))) { return nil } else { return self.$raise($scope.get('NoMethodError'), "Undefined method " + (rspec_method_name)) }; }, nil) && 'verify_invocation_order'; })(self, $scope.get('Chain')) })(self) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/mocks/any_instance/stub_chain_chain"] = 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(['$private', '$stub_chain_on', '$to_proc']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Mocks'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'AnyInstance'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $StubChainChain(){}; var self = $StubChainChain = $klass($base, $super, 'StubChainChain', $StubChainChain); var def = self.$$proto, $scope = self.$$scope; def.expectation_block = def.expectation_args = def.invocation_order = nil; self.$private(); def.$create_message_expectation_on = function(instance) { var $a, $b, self = this; return ($a = ($b = ((((Opal.get('RSpec')).$$scope.get('Mocks'))).$$scope.get('StubChain'))).$stub_chain_on, $a.$$p = self.expectation_block.$to_proc(), $a).apply($b, [instance].concat(self.expectation_args)); }; return (def.$invocation_order = function() { var $a, self = this; return ((($a = self.invocation_order) !== false && $a !== nil) ? $a : self.invocation_order = $hash2(["and_return", "and_raise", "and_yield"], {"and_return": [nil], "and_raise": [nil], "and_yield": [nil]})); }, nil) && 'invocation_order'; })(self, $scope.get('StubChain')) })(self) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/mocks/argument_list_matcher"] = 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', '$empty?', '$first', '$===', '$collect', '$matcher_for', '$match_any_args?', '$block_passes?', '$matchers_match?', '$private', '$is_matcher?', '$new', '$respond_to?', '$any?', '$call', '$==']); self.$require("rspec/mocks/argument_matchers"); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Mocks'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $ArgumentListMatcher(){}; var self = $ArgumentListMatcher = $klass($base, $super, 'ArgumentListMatcher', $ArgumentListMatcher); var def = self.$$proto, $scope = self.$$scope, TMP_1; def.block = def.matchers = def.match_any_args = nil; self.$attr_reader("expected_args"); def.$initialize = TMP_1 = function(expected_args) { var $a, $b, TMP_2, self = this, $iter = TMP_1.$$p, block = $iter || nil, $case = nil; expected_args = $slice.call(arguments, 0); TMP_1.$$p = null; self.expected_args = expected_args; self.block = (function() {if ((($a = expected_args['$empty?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return block } else { return nil }; return nil; })(); self.match_any_args = false; self.matchers = nil; return (function() {$case = expected_args.$first();if ((($scope.get('ArgumentMatchers')).$$scope.get('AnyArgsMatcher'))['$===']($case)) {return self.match_any_args = true}else if ((($scope.get('ArgumentMatchers')).$$scope.get('NoArgsMatcher'))['$===']($case)) {return self.matchers = []}else {return self.matchers = ($a = ($b = expected_args).$collect, $a.$$p = (TMP_2 = function(arg){var self = TMP_2.$$s || this; if (arg == null) arg = nil; return self.$matcher_for(arg)}, TMP_2.$$s = self, TMP_2), $a).call($b)}})(); }; def['$args_match?'] = function(args) { var $a, $b, $c, self = this; args = $slice.call(arguments, 0); return ((($a = ((($b = self['$match_any_args?']()) !== false && $b !== nil) ? $b : ($c = self)['$block_passes?'].apply($c, [].concat(args)))) !== false && $a !== nil) ? $a : ($b = self)['$matchers_match?'].apply($b, [].concat(args))); }; self.$private(); def.$matcher_for = function(arg) { var $a, self = this; if ((($a = self['$is_matcher?'](arg)) !== nil && (!$a.$$is_boolean || $a == true))) { return (($scope.get('ArgumentMatchers')).$$scope.get('MatcherMatcher')).$new(arg)}; if ((($a = $scope.get('Regexp')['$==='](arg)) !== nil && (!$a.$$is_boolean || $a == true))) { return (($scope.get('ArgumentMatchers')).$$scope.get('RegexpMatcher')).$new(arg)}; return (($scope.get('ArgumentMatchers')).$$scope.get('EqualityProxy')).$new(arg); }; def['$is_matcher?'] = function(object) { var $a, $b, $c, TMP_3, self = this; if ((($a = object['$respond_to?']("i_respond_to_everything_so_im_not_really_a_matcher")) !== nil && (!$a.$$is_boolean || $a == true))) { return false}; return ($a = ($b = ($c = ["failure_message_for_should", "failure_message"])['$any?'], $b.$$p = (TMP_3 = function(msg){var self = TMP_3.$$s || this; if (msg == null) msg = nil; return object['$respond_to?'](msg)}, TMP_3.$$s = self, TMP_3), $b).call($c), $a !== false && $a !== nil ?object['$respond_to?']("matches?") : $a); }; def['$block_passes?'] = function(args) { var $a, self = this; args = $slice.call(arguments, 0); if ((($a = self.block) !== nil && (!$a.$$is_boolean || $a == true))) { return ($a = self.block).$call.apply($a, [].concat(args)) } else { return nil }; }; def['$matchers_match?'] = function(args) { var self = this; args = $slice.call(arguments, 0); return self.matchers['$=='](args); }; def['$match_any_args?'] = function() { var self = this; return self.match_any_args; }; return $opal.cdecl($scope, 'MATCH_ALL', self.$new((($scope.get('ArgumentMatchers')).$$scope.get('AnyArgsMatcher')).$new())); })(self, null) })(self) })(self); }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/mocks/argument_matchers"] = 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(['$===', '$==', '$=~', '$include?', '$all?', '$has_key?', '$[]', '$sub', '$inspect', '$none?', '$superset?', '$new', '$join', '$respond_to?', '$matches?', '$instance_of?', '$kind_of?', '$anythingize_lonely_keys', '$first', '$count', '$alias_method', '$private', '$class', '$last', '$delete_at', '$each', '$[]=', '$anything']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Mocks'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'ArgumentMatchers'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $AnyArgsMatcher(){}; var self = $AnyArgsMatcher = $klass($base, $super, 'AnyArgsMatcher', $AnyArgsMatcher); var def = self.$$proto, $scope = self.$$scope; return (def.$description = function() { var self = this; return "any args"; }, nil) && 'description' })(self, null); (function($base, $super) { function $AnyArgMatcher(){}; var self = $AnyArgMatcher = $klass($base, $super, 'AnyArgMatcher', $AnyArgMatcher); var def = self.$$proto, $scope = self.$$scope; def.$initialize = function(ignore) { var self = this; return nil; }; return (def['$=='] = function(other) { var self = this; return true; }, nil) && '=='; })(self, null); (function($base, $super) { function $NoArgsMatcher(){}; var self = $NoArgsMatcher = $klass($base, $super, 'NoArgsMatcher', $NoArgsMatcher); var def = self.$$proto, $scope = self.$$scope; return (def.$description = function() { var self = this; return "no args"; }, nil) && 'description' })(self, null); (function($base, $super) { function $RegexpMatcher(){}; var self = $RegexpMatcher = $klass($base, $super, 'RegexpMatcher', $RegexpMatcher); var def = self.$$proto, $scope = self.$$scope; def.regexp = nil; def.$initialize = function(regexp) { var self = this; return self.regexp = regexp; }; return (def['$=='] = function(value) { var $a, self = this; if ((($a = $scope.get('Regexp')['$==='](value)) !== nil && (!$a.$$is_boolean || $a == true))) { return value['$=='](self.regexp) } else { return value['$=~'](self.regexp) }; }, nil) && '=='; })(self, null); (function($base, $super) { function $BooleanMatcher(){}; var self = $BooleanMatcher = $klass($base, $super, 'BooleanMatcher', $BooleanMatcher); var def = self.$$proto, $scope = self.$$scope; def.$initialize = function(ignore) { var self = this; return nil; }; return (def['$=='] = function(value) { var self = this; return [true, false]['$include?'](value); }, nil) && '=='; })(self, null); (function($base, $super) { function $HashIncludingMatcher(){}; var self = $HashIncludingMatcher = $klass($base, $super, 'HashIncludingMatcher', $HashIncludingMatcher); var def = self.$$proto, $scope = self.$$scope; def.expected = nil; def.$initialize = function(expected) { var self = this; return self.expected = expected; }; def['$=='] = function(actual) { var $a, $b, TMP_1, self = this; try { return ($a = ($b = self.expected)['$all?'], $a.$$p = (TMP_1 = function(k, v){var self = TMP_1.$$s || this, $a; if (k == null) k = nil;if (v == null) v = nil; return ($a = actual['$has_key?'](k), $a !== false && $a !== nil ?v['$=='](actual['$[]'](k)) : $a)}, TMP_1.$$s = self, TMP_1), $a).call($b) } catch ($err) {if ($opal.$rescue($err, [$scope.get('NoMethodError')])) { return false }else { throw $err; } }; }; return (def.$description = function() { var self = this; return "hash_including(" + (self.expected.$inspect().$sub(/^\{/, "").$sub(/\}$/, "")) + ")"; }, nil) && 'description'; })(self, null); (function($base, $super) { function $HashExcludingMatcher(){}; var self = $HashExcludingMatcher = $klass($base, $super, 'HashExcludingMatcher', $HashExcludingMatcher); var def = self.$$proto, $scope = self.$$scope; def.expected = nil; def.$initialize = function(expected) { var self = this; return self.expected = expected; }; def['$=='] = function(actual) { var $a, $b, TMP_2, self = this; try { return ($a = ($b = self.expected)['$none?'], $a.$$p = (TMP_2 = function(k, v){var self = TMP_2.$$s || this, $a; if (k == null) k = nil;if (v == null) v = nil; return ($a = actual['$has_key?'](k), $a !== false && $a !== nil ?v['$=='](actual['$[]'](k)) : $a)}, TMP_2.$$s = self, TMP_2), $a).call($b) } catch ($err) {if ($opal.$rescue($err, [$scope.get('NoMethodError')])) { return false }else { throw $err; } }; }; return (def.$description = function() { var self = this; return "hash_not_including(" + (self.expected.$inspect().$sub(/^\{/, "").$sub(/\}$/, "")) + ")"; }, nil) && 'description'; })(self, null); (function($base, $super) { function $ArrayIncludingMatcher(){}; var self = $ArrayIncludingMatcher = $klass($base, $super, 'ArrayIncludingMatcher', $ArrayIncludingMatcher); var def = self.$$proto, $scope = self.$$scope; def.expected = nil; def.$initialize = function(expected) { var self = this; return self.expected = expected; }; def['$=='] = function(actual) { var self = this; return $scope.get('Set').$new(actual)['$superset?']($scope.get('Set').$new(self.expected)); }; return (def.$description = function() { var self = this; return "array_including(" + (self.expected.$join(",")) + ")"; }, nil) && 'description'; })(self, null); (function($base, $super) { function $DuckTypeMatcher(){}; var self = $DuckTypeMatcher = $klass($base, $super, 'DuckTypeMatcher', $DuckTypeMatcher); var def = self.$$proto, $scope = self.$$scope; def.methods_to_respond_to = nil; def.$initialize = function(methods_to_respond_to) { var self = this; methods_to_respond_to = $slice.call(arguments, 0); return self.methods_to_respond_to = methods_to_respond_to; }; return (def['$=='] = function(value) { var $a, $b, TMP_3, self = this; return ($a = ($b = self.methods_to_respond_to)['$all?'], $a.$$p = (TMP_3 = function(message){var self = TMP_3.$$s || this; if (message == null) message = nil; return value['$respond_to?'](message)}, TMP_3.$$s = self, TMP_3), $a).call($b); }, nil) && '=='; })(self, null); (function($base, $super) { function $MatcherMatcher(){}; var self = $MatcherMatcher = $klass($base, $super, 'MatcherMatcher', $MatcherMatcher); var def = self.$$proto, $scope = self.$$scope; def.matcher = nil; def.$initialize = function(matcher) { var self = this; return self.matcher = matcher; }; return (def['$=='] = function(value) { var self = this; return self.matcher['$matches?'](value); }, nil) && '=='; })(self, null); (function($base, $super) { function $EqualityProxy(){}; var self = $EqualityProxy = $klass($base, $super, 'EqualityProxy', $EqualityProxy); var def = self.$$proto, $scope = self.$$scope; def.given = nil; def.$initialize = function(given) { var self = this; return self.given = given; }; return (def['$=='] = function(expected) { var self = this; return self.given['$=='](expected); }, nil) && '=='; })(self, null); (function($base, $super) { function $InstanceOf(){}; var self = $InstanceOf = $klass($base, $super, 'InstanceOf', $InstanceOf); var def = self.$$proto, $scope = self.$$scope; def.klass = nil; def.$initialize = function(klass) { var self = this; return self.klass = klass; }; return (def['$=='] = function(actual) { var self = this; return actual['$instance_of?'](self.klass); }, nil) && '=='; })(self, null); (function($base, $super) { function $KindOf(){}; var self = $KindOf = $klass($base, $super, 'KindOf', $KindOf); var def = self.$$proto, $scope = self.$$scope; def.klass = nil; def.$initialize = function(klass) { var self = this; return self.klass = klass; }; return (def['$=='] = function(actual) { var self = this; return actual['$kind_of?'](self.klass); }, nil) && '=='; })(self, null); def.$any_args = function() { var self = this; return $scope.get('AnyArgsMatcher').$new(); }; def.$anything = function() { var self = this; return $scope.get('AnyArgMatcher').$new(nil); }; def.$no_args = function() { var self = this; return $scope.get('NoArgsMatcher').$new(); }; def.$duck_type = function(args) { var $a, self = this; args = $slice.call(arguments, 0); return ($a = $scope.get('DuckTypeMatcher')).$new.apply($a, [].concat(args)); }; def.$boolean = function() { var self = this; return $scope.get('BooleanMatcher').$new(nil); }; def.$hash_including = function(args) { var $a, self = this; args = $slice.call(arguments, 0); return $scope.get('HashIncludingMatcher').$new(($a = self).$anythingize_lonely_keys.apply($a, [].concat(args))); }; def.$array_including = function(args) { var $a, $b, self = this, actually_an_array = nil; args = $slice.call(arguments, 0); actually_an_array = (function() {if ((($a = ($b = $scope.get('Array')['$==='](args.$first()), $b !== false && $b !== nil ?args.$count()['$=='](1) : $b)) !== nil && (!$a.$$is_boolean || $a == true))) { return args.$first() } else { return args }; return nil; })(); return $scope.get('ArrayIncludingMatcher').$new(actually_an_array); }; def.$hash_excluding = function(args) { var $a, self = this; args = $slice.call(arguments, 0); return $scope.get('HashExcludingMatcher').$new(($a = self).$anythingize_lonely_keys.apply($a, [].concat(args))); }; self.$alias_method("hash_not_including", "hash_excluding"); def.$instance_of = function(klass) { var self = this; return $scope.get('InstanceOf').$new(klass); }; self.$alias_method("an_instance_of", "instance_of"); def.$kind_of = function(klass) { var self = this; return $scope.get('KindOf').$new(klass); }; self.$alias_method("a_kind_of", "kind_of"); self.$private(); def.$anythingize_lonely_keys = function(args) { var $a, $b, TMP_4, self = this, hash = nil; args = $slice.call(arguments, 0); hash = (function() {if (args.$last().$class()['$==']($scope.get('Hash'))) { return args.$delete_at(-1) } else { return $hash2([], {}) }; return nil; })(); ($a = ($b = args).$each, $a.$$p = (TMP_4 = function(arg){var self = TMP_4.$$s || this; if (arg == null) arg = nil; return hash['$[]='](arg, self.$anything())}, TMP_4.$$s = self, TMP_4), $a).call($b); return hash; }; ;$opal.donate(self, ["$any_args", "$anything", "$no_args", "$duck_type", "$boolean", "$hash_including", "$array_including", "$hash_excluding", "$instance_of", "$kind_of", "$anythingize_lonely_keys"]); })(self) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/mocks/arity_calculator"] = 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(['$<=', '$min_arity', '$max_arity', '$==', '$to_s', '$private', '$method_defined?', '$>=', '$arity', '$method', '$~', '$supports_optional_and_splat_args?', '$parameters', '$any?', '$count', '$!', '$<', '$/']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Mocks'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $ArityCalculator(){}; var self = $ArityCalculator = $klass($base, $super, 'ArityCalculator', $ArityCalculator); var def = self.$$proto, $scope = self.$$scope, $a; def.method = nil; def.$initialize = function(method) { var self = this; return self.method = method; }; def['$within_range?'] = function(actual) { var $a, self = this; return (($a = self.$min_arity()['$<='](actual)) ? actual['$<='](self.$max_arity()) : $a); }; def.$range_description = function() { var self = this; if (self.$min_arity()['$=='](self.$max_arity())) { return self.$min_arity().$to_s()}; if (self.$max_arity()['$==']($scope.get('INFINITY'))) { return "" + (self.$min_arity()) + " or more"}; return "" + (self.$min_arity()) + " to " + (self.$max_arity()); }; self.$private(); def.$method = function() { var self = this; return self.method; }; $opal.defs(self, '$supports_optional_and_splat_args?', function() { var self = this; return $scope.get('Method')['$method_defined?']("parameters"); }); def.$min_arity = function() { var self = this; if (self.$method().$arity()['$>='](0)) { return self.$method().$arity()}; return self.$method().$arity()['$~'](); }; if ((($a = self['$supports_optional_and_splat_args?']()) !== nil && (!$a.$$is_boolean || $a == true))) { def.$max_arity = function() { var $a, $b, $c, TMP_1, TMP_2, self = this, params = nil; params = self.$method().$parameters(); if ((($a = ($b = ($c = params)['$any?'], $b.$$p = (TMP_1 = function(type, _){var self = TMP_1.$$s || this; if (type == null) type = nil;if (_ == null) _ = nil; return type['$==']("rest")}, TMP_1.$$s = self, TMP_1), $b).call($c)) !== nil && (!$a.$$is_boolean || $a == true))) { return $scope.get('INFINITY') } else { return ($a = ($b = params).$count, $a.$$p = (TMP_2 = function(type, _){var self = TMP_2.$$s || this; if (type == null) type = nil;if (_ == null) _ = nil; return type['$==']("block")['$!']()}, TMP_2.$$s = self, TMP_2), $a).call($b) }; } } else { def.$max_arity = function() { var self = this; if (self.$method().$arity()['$<'](0)) { return $scope.get('INFINITY') } else { return self.$method().$arity() }; } }; return $opal.cdecl($scope, 'INFINITY', (1)['$/'](0.0)); })(self, null) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/mocks/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; $opal.add_stubs(['$each', '$enable_should', '$include?', '$Array', '$enable_expect', '$disable_expect', '$disable_should', '$should_enabled?', '$<<', '$expect_enabled?', '$!', '$syntax=', '$warn_about_should!', '$new', '$reset_syntaxes_to_default', '$configuration']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Mocks'); 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; def.yield_receiver_to_any_instance_implementation_blocks = def.verify_doubled_constant_names = def.transfer_nested_constants = def.verify_partial_doubles = nil; def.$initialize = function() { var self = this; self.yield_receiver_to_any_instance_implementation_blocks = true; self.verify_doubled_constant_names = false; self.transfer_nested_constants = false; return self.verify_partial_doubles = false; }; def['$yield_receiver_to_any_instance_implementation_blocks?'] = function() { var self = this; return self.yield_receiver_to_any_instance_implementation_blocks; }; def['$yield_receiver_to_any_instance_implementation_blocks='] = function(arg) { var self = this; return self.yield_receiver_to_any_instance_implementation_blocks = arg; }; def.$add_stub_and_should_receive_to = function(modules) { var $a, $b, TMP_1, self = this; modules = $slice.call(arguments, 0); return ($a = ($b = modules).$each, $a.$$p = (TMP_1 = function(mod){var self = TMP_1.$$s || this; if (mod == null) mod = nil; return $scope.get('Syntax').$enable_should(mod)}, TMP_1.$$s = self, TMP_1), $a).call($b); }; def['$syntax='] = function(values) { var $a, self = this; if ((($a = self.$Array(values)['$include?']("expect")) !== nil && (!$a.$$is_boolean || $a == true))) { $scope.get('Syntax').$enable_expect() } else { $scope.get('Syntax').$disable_expect() }; if ((($a = self.$Array(values)['$include?']("should")) !== nil && (!$a.$$is_boolean || $a == true))) { return $scope.get('Syntax').$enable_should() } else { return $scope.get('Syntax').$disable_should() }; }; def.$syntax = function() { var $a, self = this, syntaxes = nil; syntaxes = []; if ((($a = $scope.get('Syntax')['$should_enabled?']()) !== nil && (!$a.$$is_boolean || $a == true))) { syntaxes['$<<']("should")}; if ((($a = $scope.get('Syntax')['$expect_enabled?']()) !== nil && (!$a.$$is_boolean || $a == true))) { syntaxes['$<<']("expect")}; return syntaxes; }; def['$verify_doubled_constant_names?'] = function() { var self = this; return self.verify_doubled_constant_names['$!']()['$!'](); }; def['$verify_doubled_constant_names='] = function(val) { var self = this; return self.verify_doubled_constant_names = val; }; def['$transfer_nested_constants?'] = function() { var self = this; return self.transfer_nested_constants['$!']()['$!'](); }; def['$transfer_nested_constants='] = function(val) { var self = this; return self.transfer_nested_constants = val; }; def['$verify_partial_doubles='] = function(val) { var self = this; return self.verify_partial_doubles = val['$!']()['$!'](); }; def['$verify_partial_doubles?'] = function() { var self = this; return self.verify_partial_doubles; }; return (def.$reset_syntaxes_to_default = function() { var $a, $b, self = this; (($a = [["should", "expect"]]), $b = self, $b['$syntax='].apply($b, $a), $a[$a.length-1]); return (((($scope.get('RSpec')).$$scope.get('Mocks'))).$$scope.get('Syntax'))['$warn_about_should!'](); }, nil) && 'reset_syntaxes_to_default'; })(self, null); $opal.defs(self, '$configuration', function() { var $a, self = this; if (self.configuration == null) self.configuration = nil; return ((($a = self.configuration) !== false && $a !== nil) ? $a : self.configuration = $scope.get('Configuration').$new()); }); self.$configuration().$reset_syntaxes_to_default(); })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/mocks/error_generator"] = 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(['$attr_writer', '$__raise', '$intro', '$arg_message', '$format_args', '$expected_args', '$format_received_args', '$inspect', '$message', '$join', '$collect', '$expected_part_of_expectation_error', '$received_part_of_expectation_error', '$%', '$description', '$range_description', '$+', '$count_message', '$method_call_args_description', '$first', '$===', '$>', '$length', '$gsub', '$arg_list', '$raise', '$private', '$nil?', '$[]', '$opts', '$empty?', '$arg_has_valid_description', '$respond_to?', '$!', '$received_arg_list', '$to_proc', '$<', '$==', '$pretty_print', '$abs']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Mocks'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $ErrorGenerator(){}; var self = $ErrorGenerator = $klass($base, $super, 'ErrorGenerator', $ErrorGenerator); var def = self.$$proto, $scope = self.$$scope; def.opts = def.name = def.target = nil; self.$attr_writer("opts"); def.$initialize = function(target, name) { var self = this; self.target = target; return self.name = name; }; def.$opts = function() { var $a, self = this; return ((($a = self.opts) !== false && $a !== nil) ? $a : self.opts = $hash2([], {})); }; def.$raise_unexpected_message_error = function(message, args) { var $a, self = this; args = $slice.call(arguments, 1); return self.$__raise("" + (self.$intro()) + " received unexpected message :" + (message) + (($a = self).$arg_message.apply($a, [].concat(args)))); }; def.$raise_unexpected_message_args_error = function(expectation, args) { var $a, $b, self = this, expected_args = nil, actual_args = nil; args = $slice.call(arguments, 1); expected_args = ($a = self).$format_args.apply($a, [].concat(expectation.$expected_args())); actual_args = ($b = self).$format_received_args.apply($b, [].concat(args)); return self.$__raise("" + (self.$intro()) + " received " + (expectation.$message().$inspect()) + " with unexpected arguments\n expected: " + (expected_args) + "\n got: " + (actual_args)); }; def.$raise_missing_default_stub_error = function(expectation, args) { var $a, $b, self = this, expected_args = nil, actual_args = nil; args = $slice.call(arguments, 1); expected_args = ($a = self).$format_args.apply($a, [].concat(expectation.$expected_args())); actual_args = ($b = self).$format_received_args.apply($b, [].concat(args)); return self.$__raise("" + (self.$intro()) + " received " + (expectation.$message().$inspect()) + " with unexpected arguments\n expected: " + (expected_args) + "\n got: " + (actual_args) + "\n Please stub a default value first if message might be received with other args as well. \n"); }; def.$raise_similar_message_args_error = function(expectation, args_for_multiple_calls) { var $a, $b, $c, TMP_1, self = this, expected_args = nil, actual_args = nil; args_for_multiple_calls = $slice.call(arguments, 1); expected_args = ($a = self).$format_args.apply($a, [].concat(expectation.$expected_args())); actual_args = ($b = ($c = args_for_multiple_calls).$collect, $b.$$p = (TMP_1 = function(a){var self = TMP_1.$$s || this, $a; if (a == null) a = nil; return ($a = self).$format_received_args.apply($a, [].concat(a))}, TMP_1.$$s = self, TMP_1), $b).call($c).$join(", "); return self.$__raise("" + (self.$intro()) + " received " + (expectation.$message().$inspect()) + " with unexpected arguments\n expected: " + (expected_args) + "\n got: " + (actual_args)); }; def.$raise_expectation_error = function(message, expected_received_count, argument_list_matcher, actual_received_count, expectation_count_type, args) { var $a, $b, self = this, expected_part = nil, received_part = nil; args = $slice.call(arguments, 5); expected_part = self.$expected_part_of_expectation_error(expected_received_count, expectation_count_type, argument_list_matcher); received_part = ($a = self).$received_part_of_expectation_error.apply($a, [actual_received_count].concat(args)); return self.$__raise("(" + (self.$intro()) + ")." + (message) + (($b = self).$format_args.apply($b, [].concat(args))) + "\n " + (expected_part) + "\n " + (received_part)); }; def.$raise_unimplemented_error = function(doubled_module, method_name) { var self = this; return self.$__raise("%s does not implement:\n %s"['$%']([doubled_module.$description(), method_name])); }; def.$raise_arity_error = function(calculator, actual) { var self = this; return self.$__raise("Wrong number of arguments. Expected %s, got %s."['$%']([calculator.$range_description(), actual])); }; def.$received_part_of_expectation_error = function(actual_received_count, args) { var self = this; args = $slice.call(arguments, 1); return (("received: ") + (self.$count_message(actual_received_count)))['$+'](self.$method_call_args_description(args)); }; def.$expected_part_of_expectation_error = function(expected_received_count, expectation_count_type, argument_list_matcher) { var self = this; return (("expected: ") + (self.$count_message(expected_received_count, expectation_count_type)))['$+'](self.$method_call_args_description(argument_list_matcher.$expected_args())); }; def.$method_call_args_description = function(args) { var self = this, $case = nil; $case = args.$first();if ((($scope.get('ArgumentMatchers')).$$scope.get('AnyArgsMatcher'))['$===']($case)) {return " with any arguments"}else if ((($scope.get('ArgumentMatchers')).$$scope.get('NoArgsMatcher'))['$===']($case)) {return " with no arguments"}; if (args.$length()['$>'](0)) { return " with arguments: " + (args.$inspect().$gsub(/\A\[(.+)\]\z/, "(\\1)")) } else { return "" }; }; def.$describe_expectation = function(message, expected_received_count, actual_received_count, args) { var $a, self = this; args = $slice.call(arguments, 3); return "have received " + (message) + (($a = self).$format_args.apply($a, [].concat(args))) + " " + (self.$count_message(expected_received_count)); }; def.$raise_out_of_order_error = function(message) { var self = this; return self.$__raise("" + (self.$intro()) + " received :" + (message) + " out of order"); }; def.$raise_block_failed_error = function(message, detail) { var self = this; return self.$__raise("" + (self.$intro()) + " received :" + (message) + " but passed block failed with: " + (detail)); }; def.$raise_missing_block_error = function(args_to_yield) { var $a, self = this; return self.$__raise("" + (self.$intro()) + " asked to yield |" + (($a = self).$arg_list.apply($a, [].concat(args_to_yield))) + "| but no block was passed"); }; def.$raise_wrong_arity_error = function(args_to_yield, arity) { var $a, self = this; return self.$__raise("" + (self.$intro()) + " yielded |" + (($a = self).$arg_list.apply($a, [].concat(args_to_yield))) + "| to block with arity of " + (arity)); }; def.$raise_only_valid_on_a_partial_mock = function(method) { var self = this; return self.$__raise(((((("") + (self.$intro())) + " is a pure mock object. `") + (method)) + "` is only ")['$+']("available on a partial mock object.")); }; def.$raise_expectation_on_unstubbed_method = function(method) { var self = this; return self.$__raise(((((("") + (self.$intro())) + " expected to have received ") + (method)) + ", but that ")['$+']("method has not been stubbed.")); }; def.$raise_expectation_on_mocked_method = function(method) { var self = this; return self.$__raise(((((("") + (self.$intro())) + " expected to have received ") + (method)) + ", but that ")['$+']("method has been mocked instead of stubbed.")); }; $opal.defs(self, '$raise_double_negation_error', function(wrapped_expression) { var self = this; return self.$raise("Isn't life confusing enough? You've already set a "['$+']("negative message expectation and now you are trying to ")['$+']("negate it again with `never`. What does an expression like ")['$+']("`" + (wrapped_expression) + ".not_to receive(:msg).never` even mean?")); }); self.$private(); def.$intro = function() { var $a, self = this; if ((($a = self.name) !== nil && (!$a.$$is_boolean || $a == true))) { return "Double " + (self.name.$inspect()) } else if ((($a = $scope.get('TestDouble')['$==='](self.target)) !== nil && (!$a.$$is_boolean || $a == true))) { return "Double" } else if ((($a = $scope.get('Class')['$==='](self.target)) !== nil && (!$a.$$is_boolean || $a == true))) { return "<" + (self.target.$inspect()) + " (class)>" } else if ((($a = self.target) !== nil && (!$a.$$is_boolean || $a == true))) { return self.target } else { return "nil" }; }; def.$__raise = function(message) { var $a, self = this; if ((($a = self.$opts()['$[]']("message")['$nil?']()) !== nil && (!$a.$$is_boolean || $a == true))) { } else { message = self.$opts()['$[]']("message") }; return $scope.get('Kernel').$raise((((($scope.get('RSpec')).$$scope.get('Mocks'))).$$scope.get('MockExpectationError')), message); }; def.$arg_message = function(args) { var $a, self = this; args = $slice.call(arguments, 0); return " with "['$+'](($a = self).$format_args.apply($a, [].concat(args))); }; def.$format_args = function(args) { var $a, self = this; args = $slice.call(arguments, 0); if ((($a = args['$empty?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return "(no args)" } else { return "("['$+'](($a = self).$arg_list.apply($a, [].concat(args)))['$+'](")") }; }; def.$arg_list = function(args) { var $a, $b, TMP_2, self = this; args = $slice.call(arguments, 0); return ($a = ($b = args).$collect, $a.$$p = (TMP_2 = function(arg){var self = TMP_2.$$s || this, $a; if (arg == null) arg = nil; if ((($a = self.$arg_has_valid_description(arg)) !== nil && (!$a.$$is_boolean || $a == true))) { return arg.$description() } else { return arg.$inspect() }}, TMP_2.$$s = self, TMP_2), $a).call($b).$join(", "); }; def.$arg_has_valid_description = function(arg) { var $a, self = this; if ((($a = arg['$respond_to?']("description")) !== nil && (!$a.$$is_boolean || $a == true))) { } else { return false }; return ($a = arg.$description()['$nil?']()['$!'](), $a !== false && $a !== nil ?arg.$description()['$empty?']()['$!']() : $a); }; def.$format_received_args = function(args) { var $a, self = this; args = $slice.call(arguments, 0); if ((($a = args['$empty?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return "(no args)" } else { return "("['$+'](($a = self).$received_arg_list.apply($a, [].concat(args)))['$+'](")") }; }; def.$received_arg_list = function(args) { var $a, $b, self = this; args = $slice.call(arguments, 0); return ($a = ($b = args).$collect, $a.$$p = "inspect".$to_proc(), $a).call($b).$join(", "); }; def.$count_message = function(count, expectation_count_type) { var $a, $b, self = this; if (expectation_count_type == null) { expectation_count_type = nil } if ((($a = ((($b = count['$<'](0)) !== false && $b !== nil) ? $b : expectation_count_type['$==']("at_least"))) !== nil && (!$a.$$is_boolean || $a == true))) { return "at least " + (self.$pretty_print(count.$abs()))}; if (expectation_count_type['$==']("at_most")) { return "at most " + (self.$pretty_print(count))}; return self.$pretty_print(count); }; return (def.$pretty_print = function(count) { var self = this; return "" + (count) + " time" + ((function() {if (count['$=='](1)) { return "" } else { return "s" }; return nil; })()); }, nil) && 'pretty_print'; })(self, null) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/mocks/errors"] = 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([]); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Mocks'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $MockExpectationError(){}; var self = $MockExpectationError = $klass($base, $super, 'MockExpectationError', $MockExpectationError); var def = self.$$proto, $scope = self.$$scope; return nil; })(self, $scope.get('Exception')); (function($base, $super) { function $AmbiguousReturnError(){}; var self = $AmbiguousReturnError = $klass($base, $super, 'AmbiguousReturnError', $AmbiguousReturnError); var def = self.$$proto, $scope = self.$$scope; return nil; })(self, $scope.get('StandardError')); })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/mocks/example_methods"] = 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, $hash2 = $opal.hash2; $opal.add_stubs(['$require', '$include', '$declare_double', '$for', '$declare_verifying_double', '$warn_about_expectations=', '$proxy_for', '$space', '$stub', '$hide', '$new', '$to_proc', '$class_exec', '$method_defined?', '$private', '$verify_doubled_constant_names?', '$configuration', '$!', '$defined?', '$raise', '$+', '$name', '$===', '$last', '$<<']); self.$require("rspec/mocks/object_reference"); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Mocks'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'ExampleMethods'); var def = self.$$proto, $scope = self.$$scope, TMP_1; self.$include((((($scope.get('RSpec')).$$scope.get('Mocks'))).$$scope.get('ArgumentMatchers'))); def.$double = function(args) { var $a, self = this; args = $slice.call(arguments, 0); return ($a = self).$declare_double.apply($a, [$scope.get('Mock')].concat(args)); }; def.$instance_double = function(doubled_class, args) { var $a, self = this, ref = nil; args = $slice.call(arguments, 1); ref = $scope.get('ObjectReference').$for(doubled_class); return ($a = self).$declare_verifying_double.apply($a, [$scope.get('InstanceVerifyingDouble'), ref].concat(args)); }; def.$class_double = function(doubled_class, args) { var $a, self = this, ref = nil; args = $slice.call(arguments, 1); ref = $scope.get('ObjectReference').$for(doubled_class); return ($a = self).$declare_verifying_double.apply($a, [$scope.get('ClassVerifyingDouble'), ref].concat(args)); }; def.$object_double = function(object_or_name, args) { var $a, self = this, ref = nil; args = $slice.call(arguments, 1); ref = $scope.get('ObjectReference').$for(object_or_name, "allow_direct_object_refs"); return ($a = self).$declare_verifying_double.apply($a, [$scope.get('ObjectVerifyingDouble'), ref].concat(args)); }; def.$allow_message_expectations_on_nil = function() { var $a, $b, self = this; return (($a = [false]), $b = (($scope.get('RSpec')).$$scope.get('Mocks')).$space().$proxy_for(nil), $b['$warn_about_expectations='].apply($b, $a), $a[$a.length-1]); }; def.$stub_const = function(constant_name, value, options) { var self = this; if (options == null) { options = $hash2([], {}) } return $scope.get('ConstantMutator').$stub(constant_name, value, options); }; def.$hide_const = function(constant_name) { var self = this; return $scope.get('ConstantMutator').$hide(constant_name); }; def.$have_received = TMP_1 = function(method_name) { var $a, $b, self = this, $iter = TMP_1.$$p, block = $iter || nil; TMP_1.$$p = null; return ($a = ($b = (($scope.get('Matchers')).$$scope.get('HaveReceived'))).$new, $a.$$p = block.$to_proc(), $a).call($b, method_name); }; $opal.defs(self, '$included', function(klass) { var $a, $b, TMP_2, self = this; return ($a = ($b = klass).$class_exec, $a.$$p = (TMP_2 = function(){var self = TMP_2.$$s || this, $a; if ((($a = self['$method_defined?']("expect")) !== nil && (!$a.$$is_boolean || $a == true))) { return nil } else { return self.$include($scope.get('ExpectHost')) }}, TMP_2.$$s = self, TMP_2), $a).call($b); }); self.$private(); def.$declare_verifying_double = function(type, ref, args) { var $a, $b, self = this; args = $slice.call(arguments, 2); if ((($a = ($b = (($scope.get('RSpec')).$$scope.get('Mocks')).$configuration()['$verify_doubled_constant_names?'](), $b !== false && $b !== nil ?ref['$defined?']()['$!']() : $b)) !== nil && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('NameError'), ((("") + (ref.$name())) + " is not a defined constant. ")['$+']("Perhaps you misspelt it? ")['$+']("Disable check with verify_doubled_constant_names configuration option."))}; return ($a = self).$declare_double.apply($a, [type, ref].concat(args)); }; def.$declare_double = function(type, args) { var $a, self = this; args = $slice.call(arguments, 1); if ((($a = $scope.get('Hash')['$==='](args.$last())) !== nil && (!$a.$$is_boolean || $a == true))) { } else { args['$<<']($hash2([], {})) }; return ($a = type).$new.apply($a, [].concat(args)); }; (function($base) { var self = $module($base, 'ExpectHost'); var def = self.$$proto, $scope = self.$$scope; nil })(self); ;$opal.donate(self, ["$double", "$instance_double", "$class_double", "$object_double", "$allow_message_expectations_on_nil", "$stub_const", "$hide_const", "$have_received", "$declare_verifying_double", "$declare_double"]); })(self) })(self) })(self); }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/mocks/extensions/marshal"] = 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(['$nil?', '$space', '$!', '$registered?', '$===', '$dump_without_mocks', '$dup', '$alias_method', '$undef_method']); return (function($base) { var self = $module($base, 'Marshal'); var def = self.$$proto, $scope = self.$$scope; (function(self) { var $scope = self.$$scope, def = self.$$proto; self.$$proto.$dump_with_mocks = function(object, rest) { var $a, $b, $c, self = this; rest = $slice.call(arguments, 1); if ((($a = ((($b = ((($c = ((Opal.get('RSpec')).$$scope.get('Mocks')).$space()['$nil?']()) !== false && $c !== nil) ? $c : ((Opal.get('RSpec')).$$scope.get('Mocks')).$space()['$registered?'](object)['$!']())) !== false && $b !== nil) ? $b : $scope.get('NilClass')['$==='](object))) !== nil && (!$a.$$is_boolean || $a == true))) { return ($a = self).$dump_without_mocks.apply($a, [object].concat(rest)) } else { return ($b = self).$dump_without_mocks.apply($b, [object.$dup()].concat(rest)) }; }; self.$alias_method("dump_without_mocks", "dump"); self.$undef_method("dump"); return self.$alias_method("dump", "dump_with_mocks"); })(self.$singleton_class()) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/mocks/framework"] = 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/support/caller_filter"); self.$require("rspec/support/warnings"); self.$require("rspec/mocks/instance_method_stasher"); self.$require("rspec/mocks/method_double"); self.$require("rspec/mocks/argument_matchers"); self.$require("rspec/mocks/example_methods"); self.$require("rspec/mocks/proxy"); self.$require("rspec/mocks/proxy_for_nil"); self.$require("rspec/mocks/test_double"); self.$require("rspec/mocks/mock"); self.$require("rspec/mocks/argument_list_matcher"); self.$require("rspec/mocks/message_expectation"); self.$require("rspec/mocks/order_group"); self.$require("rspec/mocks/errors"); self.$require("rspec/mocks/error_generator"); self.$require("rspec/mocks/space"); self.$require("rspec/mocks/extensions/marshal"); self.$require("rspec/mocks/any_instance/chain"); self.$require("rspec/mocks/any_instance/stub_chain"); self.$require("rspec/mocks/any_instance/stub_chain_chain"); self.$require("rspec/mocks/any_instance/expectation_chain"); self.$require("rspec/mocks/any_instance/message_chains"); self.$require("rspec/mocks/any_instance/recorder"); self.$require("rspec/mocks/mutate_const"); self.$require("rspec/mocks/matchers/have_received"); self.$require("rspec/mocks/matchers/receive"); self.$require("rspec/mocks/matchers/receive_messages"); self.$require("rspec/mocks/stub_chain"); self.$require("rspec/mocks/targets"); self.$require("rspec/mocks/syntax"); self.$require("rspec/mocks/configuration"); return self.$require("rspec/mocks/verifying_double"); }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/mocks/instance_method_stasher"] = 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(['$attr_reader', '$<', '$to_f', '$!', '$method_defined_directly_on_klass?', '$__send__', '$stashed_method_name', '$private', '$method_handle_for', '$method_defined_on_klass?', '$method_owned_by_klass?', '$method_defined?', '$private_method_defined?', '$owner', '$instance_method', '$===', '$class', '$==']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Mocks'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $InstanceMethodStasher(){}; var self = $InstanceMethodStasher = $klass($base, $super, 'InstanceMethodStasher', $InstanceMethodStasher); var def = self.$$proto, $scope = self.$$scope; def.method_is_stashed = def.klass = def.method = def.original_method = def.object = nil; def.$initialize = function(object, method) { var self = this; self.object = object; self.method = method; self.klass = ((function(self) { var $scope = self.$$scope, def = self.$$proto; return self })(object.$singleton_class())); self.original_method = nil; return self.method_is_stashed = false; }; self.$attr_reader("original_method"); if ($scope.get('RUBY_VERSION').$to_f()['$<'](1.9)) { def['$method_is_stashed?'] = function() { var self = this; return self.method_is_stashed; }; def.$stash = function() { var $a, $b, self = this; if ((($a = ((($b = self['$method_defined_directly_on_klass?']()['$!']()) !== false && $b !== nil) ? $b : self.method_is_stashed)) !== nil && (!$a.$$is_boolean || $a == true))) { return nil}; self.klass.$__send__("alias_method", self.$stashed_method_name(), self.method); return self.method_is_stashed = true; }; def.$stashed_method_name = function() { var self = this; return "obfuscated_by_rspec_mocks__" + (self.method); }; self.$private("stashed_method_name"); def.$restore = function() { var $a, self = this; if ((($a = self.method_is_stashed) !== nil && (!$a.$$is_boolean || $a == true))) { } else { return nil }; if ((($a = self.klass.$__send__("method_defined?", self.method)) !== nil && (!$a.$$is_boolean || $a == true))) { self.klass.$__send__("undef_method", self.method)}; self.klass.$__send__("alias_method", self.method, self.$stashed_method_name()); self.klass.$__send__("remove_method", self.$stashed_method_name()); return self.method_is_stashed = false; }; } else { def['$method_is_stashed?'] = function() { var self = this; return self.original_method['$!']()['$!'](); }; def.$stash = function() { var $a, self = this; if ((($a = self['$method_defined_directly_on_klass?']()['$!']()) !== nil && (!$a.$$is_boolean || $a == true))) { return nil}; return ((($a = self.original_method) !== false && $a !== nil) ? $a : self.original_method = ((Opal.get('RSpec')).$$scope.get('Mocks')).$method_handle_for(self.object, self.method)); }; def.$restore = function() { var $a, self = this; if ((($a = self.original_method) !== nil && (!$a.$$is_boolean || $a == true))) { } else { return nil }; if ((($a = self.klass.$__send__("method_defined?", self.method)) !== nil && (!$a.$$is_boolean || $a == true))) { self.klass.$__send__("undef_method", self.method)}; self.klass.$__send__("define_method", self.method, self.original_method); return self.original_method = nil; }; }; self.$private(); def['$method_defined_directly_on_klass?'] = function() { var $a, self = this; return ($a = self['$method_defined_on_klass?'](), $a !== false && $a !== nil ?self['$method_owned_by_klass?']() : $a); }; def['$method_defined_on_klass?'] = function(klass) { var $a, self = this; if (klass == null) { klass = self.klass } return ((($a = klass['$method_defined?'](self.method)) !== false && $a !== nil) ? $a : klass['$private_method_defined?'](self.method)); }; return (def['$method_owned_by_klass?'] = function() { var $a, self = this, owner = nil; owner = self.klass.$instance_method(self.method).$owner(); if ((($a = $scope.get('Module')['$==='](owner)) !== nil && (!$a.$$is_boolean || $a == true))) { } else { owner = owner.$class() }; return ((($a = owner['$=='](self.klass)) !== false && $a !== nil) ? $a : (self['$method_defined_on_klass?'](owner))['$!']()); }, nil) && 'method_owned_by_klass?'; })(self, null) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/mocks/matchers/have_received"] = 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(['$+', '$expect', '$expected_messages_received_in_order?', '$ensure_count_unconstrained', '$never', '$generate_failure_message', '$description', '$each', '$define_method', '$<<', '$private', '$build_expectation', '$mock_proxy', '$apply_constraints_to', '$send', '$count_constraint', '$raise', '$detect', '$include?', '$map', '$to_proc', '$check_for_unexpected_arguments', '$generate_error', '$message', '$replay_received_message_on', '$expected_messages_received?', '$ensure_expected_ordering_received!', '$proxy_for']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Mocks'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Matchers'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $HaveReceived(){}; var self = $HaveReceived = $klass($base, $super, 'HaveReceived', $HaveReceived); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, $a, $b, TMP_3; def.block = def.method_name = def.constraints = def.expectation = def.subject = nil; $opal.cdecl($scope, 'COUNT_CONSTRAINTS', ["exactly", "at_least", "at_most", "times", "once", "twice"]); $opal.cdecl($scope, 'ARGS_CONSTRAINTS', ["with"]); $opal.cdecl($scope, 'CONSTRAINTS', $scope.get('COUNT_CONSTRAINTS')['$+']($scope.get('ARGS_CONSTRAINTS'))['$+'](["ordered"])); def.$initialize = TMP_1 = function(method_name) { var self = this, $iter = TMP_1.$$p, block = $iter || nil; TMP_1.$$p = null; self.method_name = method_name; self.block = block; self.constraints = []; return self.subject = nil; }; def.$name = function() { var self = this; return "have_received"; }; def['$matches?'] = TMP_2 = function(subject) { var $a, self = this, $iter = TMP_2.$$p, block = $iter || nil; TMP_2.$$p = null; ((($a = self.block) !== false && $a !== nil) ? $a : self.block = block); self.subject = subject; self.expectation = self.$expect(); return self['$expected_messages_received_in_order?'](); }; def['$does_not_match?'] = function(subject) { var self = this; self.subject = subject; self.$ensure_count_unconstrained(); self.expectation = self.$expect().$never(); return self['$expected_messages_received_in_order?'](); }; def.$failure_message = function() { var self = this; return self.$generate_failure_message(); }; def.$negative_failure_message = function() { var self = this; return self.$generate_failure_message(); }; def.$description = function() { var self = this; return self.$expect().$description(); }; ($a = ($b = $scope.get('CONSTRAINTS')).$each, $a.$$p = (TMP_3 = function(expectation){var self = TMP_3.$$s || this, $a, $b, TMP_4; if (expectation == null) expectation = nil; return ($a = ($b = self).$define_method, $a.$$p = (TMP_4 = function(args){var self = TMP_4.$$s || this; if (self.constraints == null) self.constraints = nil; args = $slice.call(arguments, 0); self.constraints['$<<']([expectation].concat(args)); return self;}, TMP_4.$$s = self, TMP_4), $a).call($b, expectation)}, TMP_3.$$s = self, TMP_3), $a).call($b); self.$private(); def.$expect = function() { var self = this, expectation = nil; expectation = self.$mock_proxy().$build_expectation(self.method_name); self.$apply_constraints_to(expectation); return expectation; }; def.$apply_constraints_to = function(expectation) { var $a, $b, TMP_5, self = this; return ($a = ($b = self.constraints).$each, $a.$$p = (TMP_5 = function(constraint){var self = TMP_5.$$s || this, $a; if (constraint == null) constraint = nil; return ($a = expectation).$send.apply($a, [].concat(constraint))}, TMP_5.$$s = self, TMP_5), $a).call($b); }; def.$ensure_count_unconstrained = function() { var $a, self = this; if ((($a = self.$count_constraint()) !== nil && (!$a.$$is_boolean || $a == true))) { return self.$raise((((($scope.get('RSpec')).$$scope.get('Mocks'))).$$scope.get('MockExpectationError')), "can't use " + (self.$count_constraint()) + " when negative") } else { return nil }; }; def.$count_constraint = function() { var $a, $b, TMP_6, $c, $d, self = this; return ($a = ($b = ($c = ($d = self.constraints).$map, $c.$$p = "first".$to_proc(), $c).call($d)).$detect, $a.$$p = (TMP_6 = function(constraint){var self = TMP_6.$$s || this; if (constraint == null) constraint = nil; return $scope.get('COUNT_CONSTRAINTS')['$include?'](constraint)}, TMP_6.$$s = self, TMP_6), $a).call($b); }; def.$generate_failure_message = function() { var self = this, error = nil; try { self.$mock_proxy().$check_for_unexpected_arguments(self.expectation); return self.expectation.$generate_error(); } catch ($err) {if ($opal.$rescue($err, [(((($scope.get('RSpec')).$$scope.get('Mocks'))).$$scope.get('MockExpectationError'))])) {error = $err; return error.$message() }else { throw $err; } }; }; def['$expected_messages_received_in_order?'] = function() { var $a, $b, self = this; ($a = ($b = self.$mock_proxy()).$replay_received_message_on, $a.$$p = self.block.$to_proc(), $a).call($b, self.expectation); return ($a = self.expectation['$expected_messages_received?'](), $a !== false && $a !== nil ?self.expectation['$ensure_expected_ordering_received!']() : $a); }; return (def.$mock_proxy = function() { var self = this; return (($scope.get('RSpec')).$$scope.get('Mocks')).$proxy_for(self.subject); }, nil) && 'mock_proxy'; })(self, null) })(self) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/mocks/matchers/receive"] = 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(['$first_non_rspec_line', '$warn_if_any_instance', '$setup_mock_proxy_method_substitute', '$unshift', '$new', '$setup_expectation', '$to_proc', '$setup_any_instance_method_substitute', '$each', '$method_defined?', '$define_method', '$<<', '$public_instance_methods', '$private', '$===', '$warning', '$klass', '$proxy_for', '$setup_method_substitute', '$any_instance_recorder_for', '$to_sym', '$__send__', '$playback_onto']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Mocks'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Matchers'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Receive(){}; var self = $Receive = $klass($base, $super, 'Receive', $Receive); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, $a, $b, TMP_7; def.recorded_customizations = def.backtrace_line = def.message = def.block = nil; def.$initialize = function(message, block) { var self = this; self.message = message; self.block = block; self.recorded_customizations = []; return self.backtrace_line = $scope.get('CallerFilter').$first_non_rspec_line(); }; def.$name = function() { var self = this; return "receive"; }; def.$setup_expectation = TMP_1 = function(subject) { var self = this, $iter = TMP_1.$$p, block = $iter || nil; TMP_1.$$p = null; self.$warn_if_any_instance("expect", subject); return self.$setup_mock_proxy_method_substitute(subject, "add_message_expectation", block); }; $opal.defn(self, '$matches?', def.$setup_expectation); def.$setup_negative_expectation = TMP_2 = function(subject) { var $a, $b, self = this, $iter = TMP_2.$$p, block = $iter || nil; TMP_2.$$p = null; self.recorded_customizations.$unshift($scope.get('Customization').$new("never", [], nil)); self.$warn_if_any_instance("expect", subject); return ($a = ($b = self).$setup_expectation, $a.$$p = block.$to_proc(), $a).call($b, subject); }; $opal.defn(self, '$does_not_match?', def.$setup_negative_expectation); def.$setup_allowance = TMP_3 = function(subject) { var self = this, $iter = TMP_3.$$p, block = $iter || nil; TMP_3.$$p = null; self.$warn_if_any_instance("allow", subject); return self.$setup_mock_proxy_method_substitute(subject, "add_stub", block); }; def.$setup_any_instance_expectation = TMP_4 = function(subject) { var self = this, $iter = TMP_4.$$p, block = $iter || nil; TMP_4.$$p = null; return self.$setup_any_instance_method_substitute(subject, "should_receive", block); }; def.$setup_any_instance_negative_expectation = TMP_5 = function(subject) { var self = this, $iter = TMP_5.$$p, block = $iter || nil; TMP_5.$$p = null; return self.$setup_any_instance_method_substitute(subject, "should_not_receive", block); }; def.$setup_any_instance_allowance = TMP_6 = function(subject) { var self = this, $iter = TMP_6.$$p, block = $iter || nil; TMP_6.$$p = null; return self.$setup_any_instance_method_substitute(subject, "stub", block); }; ($a = ($b = $scope.get('MessageExpectation').$public_instance_methods(false)).$each, $a.$$p = (TMP_7 = function(method){var self = TMP_7.$$s || this, $a, $b, TMP_8; if (method == null) method = nil; if ((($a = self['$method_defined?'](method)) !== nil && (!$a.$$is_boolean || $a == true))) { return nil;}; return ($a = ($b = self).$define_method, $a.$$p = (TMP_8 = function(args){var self = TMP_8.$$s || this, block; if (self.recorded_customizations == null) self.recorded_customizations = nil; args = $slice.call(arguments, 0); block = TMP_8.$$p || nil, TMP_8.$$p = null; self.recorded_customizations['$<<']($scope.get('Customization').$new(method, args, block)); return self;}, TMP_8.$$s = self, TMP_8), $a).call($b, method);}, TMP_7.$$s = self, TMP_7), $a).call($b); self.$private(); def.$warn_if_any_instance = function(expression, subject) { var $a, self = this; if ((($a = (($scope.get('AnyInstance')).$$scope.get('Recorder'))['$==='](subject)) !== nil && (!$a.$$is_boolean || $a == true))) { return $scope.get('RSpec').$warning(((((("`") + (expression)) + "(") + (subject.$klass())) + ".any_instance).to` ")['$<<']("is probably not what you meant, it does not operate on ")['$<<']("any instance of `" + (subject.$klass()) + "`. ")['$<<']("Use `" + (expression) + "_any_instance_of(" + (subject.$klass()) + ").to` instead.")) } else { return nil }; }; def.$setup_mock_proxy_method_substitute = function(subject, method, block) { var self = this, proxy = nil; proxy = ((Opal.get('RSpec')).$$scope.get('Mocks')).$proxy_for(subject); return self.$setup_method_substitute(proxy, method, block, self.backtrace_line); }; def.$setup_any_instance_method_substitute = function(subject, method, block) { var self = this, any_instance_recorder = nil; any_instance_recorder = ((Opal.get('RSpec')).$$scope.get('Mocks')).$any_instance_recorder_for(subject); return self.$setup_method_substitute(any_instance_recorder, method, block); }; def.$setup_method_substitute = function(host, method, block, args) { var $a, $b, $c, TMP_9, self = this, expectation = nil; args = $slice.call(arguments, 3); args['$<<'](self.message.$to_sym()); expectation = ($a = ($b = host).$__send__, $a.$$p = (((($c = self.block) !== false && $c !== nil) ? $c : block)).$to_proc(), $a).apply($b, [method].concat(args)); ($a = ($c = self.recorded_customizations).$each, $a.$$p = (TMP_9 = function(customization){var self = TMP_9.$$s || this; if (customization == null) customization = nil; return customization.$playback_onto(expectation)}, TMP_9.$$s = self, TMP_9), $a).call($c); return expectation; }; return (function($base, $super) { function $Customization(){}; var self = $Customization = $klass($base, $super, 'Customization', $Customization); var def = self.$$proto, $scope = self.$$scope; def.block = def.method_name = def.args = nil; def.$initialize = function(method_name, args, block) { var self = this; self.method_name = method_name; self.args = args; return self.block = block; }; return (def.$playback_onto = function(expectation) { var $a, $b, self = this; return ($a = ($b = expectation).$__send__, $a.$$p = self.block.$to_proc(), $a).apply($b, [self.method_name].concat(self.args)); }, nil) && 'playback_onto'; })(self, null); })(self, null) })(self) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/mocks/matchers/receive_messages"] = 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(['$first_non_rspec_line', '$warn_about_block', '$each_message_on', '$add_simple_expectation', '$proxy_on', '$raise', '$+', '$add_simple_stub', '$and_return', '$should_receive', '$any_instance_of', '$stub', '$private', '$proxy_for', '$any_instance_recorder_for', '$each']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Mocks'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Matchers'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $ReceiveMessages(){}; var self = $ReceiveMessages = $klass($base, $super, 'ReceiveMessages', $ReceiveMessages); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_3, TMP_5, TMP_7, TMP_9; def.message_return_value_hash = nil; def.$initialize = function(message_return_value_hash) { var self = this; self.message_return_value_hash = message_return_value_hash; return self.backtrace_line = $scope.get('CallerFilter').$first_non_rspec_line(); }; def.$name = function() { var self = this; return "receive_messages"; }; def.$setup_expectation = TMP_1 = function(subject) { var $a, $b, TMP_2, self = this, $iter = TMP_1.$$p, $yield = $iter || nil; TMP_1.$$p = null; if (($yield !== nil)) { self.$warn_about_block()}; return ($a = ($b = self).$each_message_on, $a.$$p = (TMP_2 = function(host, message, return_value){var self = TMP_2.$$s || this; if (self.backtrace_line == null) self.backtrace_line = nil; if (host == null) host = nil;if (message == null) message = nil;if (return_value == null) return_value = nil; return host.$add_simple_expectation(message, return_value, self.backtrace_line)}, TMP_2.$$s = self, TMP_2), $a).call($b, self.$proxy_on(subject)); }; $opal.defn(self, '$matches?', def.$setup_expectation); def.$setup_negative_expectation = function(subject) { var self = this; return self.$raise($scope.get('NegationUnsupportedError'), "`expect(...).to_not receive_messages` is not supported since it "['$+']("doesn't really make sense. What would it even mean?")); }; $opal.defn(self, '$does_not_match?', def.$setup_negative_expectation); def.$setup_allowance = TMP_3 = function(subject) { var $a, $b, TMP_4, self = this, $iter = TMP_3.$$p, $yield = $iter || nil; TMP_3.$$p = null; if (($yield !== nil)) { self.$warn_about_block()}; return ($a = ($b = self).$each_message_on, $a.$$p = (TMP_4 = function(host, message, return_value){var self = TMP_4.$$s || this; if (host == null) host = nil;if (message == null) message = nil;if (return_value == null) return_value = nil; return host.$add_simple_stub(message, return_value)}, TMP_4.$$s = self, TMP_4), $a).call($b, self.$proxy_on(subject)); }; def.$setup_any_instance_expectation = TMP_5 = function(subject) { var $a, $b, TMP_6, self = this, $iter = TMP_5.$$p, $yield = $iter || nil; TMP_5.$$p = null; if (($yield !== nil)) { self.$warn_about_block()}; return ($a = ($b = self).$each_message_on, $a.$$p = (TMP_6 = function(host, message, return_value){var self = TMP_6.$$s || this; if (host == null) host = nil;if (message == null) message = nil;if (return_value == null) return_value = nil; return host.$should_receive(message).$and_return(return_value)}, TMP_6.$$s = self, TMP_6), $a).call($b, self.$any_instance_of(subject)); }; def.$setup_any_instance_allowance = TMP_7 = function(subject) { var self = this, $iter = TMP_7.$$p, $yield = $iter || nil; TMP_7.$$p = null; if (($yield !== nil)) { self.$warn_about_block()}; return self.$any_instance_of(subject).$stub(self.message_return_value_hash); }; def.$warn_about_block = function() { var self = this; return self.$raise("Implementation blocks aren't supported with `receive_messages`"); }; self.$private(); def.$proxy_on = function(subject) { var self = this; return ((Opal.get('RSpec')).$$scope.get('Mocks')).$proxy_for(subject); }; def.$any_instance_of = function(subject) { var self = this; return ((Opal.get('RSpec')).$$scope.get('Mocks')).$any_instance_recorder_for(subject); }; return (def.$each_message_on = TMP_9 = function(host) { var $a, $b, TMP_8, self = this, $iter = TMP_9.$$p, $yield = $iter || nil; TMP_9.$$p = null; return ($a = ($b = self.message_return_value_hash).$each, $a.$$p = (TMP_8 = function(message, value){var self = TMP_8.$$s || this, $a; if (message == null) message = nil;if (value == null) value = nil; return $a = $opal.$yieldX($yield, [host, message, value]), $a === $breaker ? $a : $a}, TMP_8.$$s = self, TMP_8), $a).call($b); }, nil) && 'each_message_on'; })(self, null) })(self) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/mocks/message_expectation"] = 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(['$==', '$line', '$raise_expectation_error', '$attr_accessor', '$attr_reader', '$attr_writer', '$protected', '$opts=', '$object', '$method_name', '$register', '$new', '$inner_implementation_action=', '$expected_args', '$negative?', '$raise', '$ignoring_args?', '$max', '$size', '$terminal_implementation_action=', '$===', '$raise_only_valid_on_a_partial_mock', '$inner_action', '$implementation', '$warning', '$original_method', '$respond_to?', '$exception', '$throw', '$<<', '$initial_implementation_action=', '$args_match?', '$yield_receiver_to_implementation_block?', '$unshift', '$orig_object', '$+', '$expectation_count_type', '$handle_order_constraint', '$present?', '$call', '$to_proc', '$invoke', '$!', '$>', '$>=', '$expected_messages_received?', '$failed_fast?', '$generate_error', '$matches_exact_count?', '$matches_at_least_count?', '$matches_at_most_count?', '$verify_invocation_order', '$<=', '$similar_messages', '$empty?', '$raise_similar_message_args_error', '$describe_expectation', '$raise_out_of_order_error', '$set_expected_received_count', '$raise_double_negation_error', '$private', '$initial_action=', '$inner_action=', '$terminal_action=', '$nil?', '$raise_missing_block_error', '$each', '$arity', '$length', '$raise_wrong_arity_error', '$instance_exec', '$shift', '$first', '$last', '$map', '$actions', '$any?', '$compact', '$initial_action', '$terminal_action', '$cannot_modify_further_error', '$insert', '$backtrace']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Mocks'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $SimpleMessageExpectation(){}; var self = $SimpleMessageExpectation = $klass($base, $super, 'SimpleMessageExpectation', $SimpleMessageExpectation); var def = self.$$proto, $scope = self.$$scope; def.response = def.message = def.backtrace_line = nil; def.$initialize = function(message, response, error_generator, backtrace_line) { var $a, self = this; if (backtrace_line == null) { backtrace_line = nil } $a = [message, response, error_generator, backtrace_line], self.message = $a[0], self.response = $a[1], self.error_generator = $a[2], self.backtrace_line = $a[3]; return self.received = false; }; def.$invoke = function(_) { var self = this; _ = $slice.call(arguments, 0); self.received = true; return self.response; }; def['$matches?'] = function(message, _) { var self = this; _ = $slice.call(arguments, 1); return self.message['$=='](message); }; def['$called_max_times?'] = function() { var self = this; return false; }; return (def.$verify_messages_received = function() { var $a, $b, TMP_1, self = this; return ($a = ($b = $scope.get('InsertOntoBacktrace')).$line, $a.$$p = (TMP_1 = function(){var self = TMP_1.$$s || this, $a; if (self.received == null) self.received = nil; if (self.error_generator == null) self.error_generator = nil; if (self.message == null) self.message = nil; if ((($a = self.received) !== nil && (!$a.$$is_boolean || $a == true))) { return nil } else { return self.error_generator.$raise_expectation_error(self.message, 1, (($scope.get('ArgumentListMatcher')).$$scope.get('MATCH_ALL')), 0, nil) }}, TMP_1.$$s = self, TMP_1), $a).call($b, self.backtrace_line); }, nil) && 'verify_messages_received'; })(self, null); (function($base, $super) { function $MessageExpectation(){}; var self = $MessageExpectation = $klass($base, $super, 'MessageExpectation', $MessageExpectation); var def = self.$$proto, $scope = self.$$scope, TMP_2, TMP_3, TMP_6, TMP_7, TMP_9, TMP_10, TMP_11, TMP_12, TMP_13, TMP_14, TMP_15, TMP_16; def.error_generator = def.method_double = def.order_group = def.argument_list_matcher = def.expected_received_count = def.at_least = def.yield_receiver_to_implementation_block = def.args_to_yield = def.eval_context = def.message = def.exactly = def.at_most = def.actual_received_count = def.expected_from = def.ordered = def.similar_messages = def.failed_fast = nil; self.$attr_accessor("error_generator", "implementation"); self.$attr_reader("message"); self.$attr_reader("orig_object"); self.$attr_writer("expected_received_count", "expected_from", "argument_list_matcher"); self.$protected("expected_received_count=", "expected_from=", "error_generator", "error_generator=", "implementation="); def.$initialize = TMP_2 = function(error_generator, expectation_ordering, expected_from, method_double, expected_received_count, opts) { var $a, $b, self = this, $iter = TMP_2.$$p, implementation_block = $iter || nil; if (expected_received_count == null) { expected_received_count = 1 } if (opts == null) { opts = $hash2([], {}) } TMP_2.$$p = null; self.error_generator = error_generator; (($a = [opts]), $b = self.error_generator, $b['$opts='].apply($b, $a), $a[$a.length-1]); self.expected_from = expected_from; self.method_double = method_double; self.orig_object = self.method_double.$object(); self.message = self.method_double.$method_name(); self.actual_received_count = 0; self.expected_received_count = expected_received_count; self.argument_list_matcher = (($scope.get('ArgumentListMatcher')).$$scope.get('MATCH_ALL')); self.order_group = expectation_ordering; self.order_group.$register(self); self.ordered = false; self.at_least = self.at_most = self.exactly = nil; self.args_to_yield = []; self.failed_fast = nil; self.eval_context = nil; self.yield_receiver_to_implementation_block = false; self.implementation = $scope.get('Implementation').$new(); return (($a = [implementation_block]), $b = self, $b['$inner_implementation_action='].apply($b, $a), $a[$a.length-1]); }; def.$expected_args = function() { var self = this; return self.argument_list_matcher.$expected_args(); }; def.$and_return = TMP_3 = function(values) { var $a, $b, $c, self = this, $iter = TMP_3.$$p, implementation = $iter || nil; values = $slice.call(arguments, 0); TMP_3.$$p = null; if ((($a = self['$negative?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return self.$raise("`and_return` is not supported with negative message expectations") } else { if ((($a = ((($b = self['$ignoring_args?']()) !== false && $b !== nil) ? $b : ((($c = self.expected_received_count['$=='](0)) ? self.at_least : $c)))) !== nil && (!$a.$$is_boolean || $a == true))) { } else { self.expected_received_count = [self.expected_received_count, values.$size()].$max() }; if (implementation !== false && implementation !== nil) { (($a = [implementation]), $b = self, $b['$inner_implementation_action='].apply($b, $a), $a[$a.length-1]) } else { (($a = [$scope.get('AndReturnImplementation').$new(values)]), $b = self, $b['$terminal_implementation_action='].apply($b, $a), $a[$a.length-1]) }; return nil; }; }; def.$and_yield_receiver_to_implementation = function() { var self = this; self.yield_receiver_to_implementation_block = true; return self; }; def['$yield_receiver_to_implementation_block?'] = function() { var self = this; return self.yield_receiver_to_implementation_block; }; def.$and_call_original = function() { var $a, self = this; if ((($a = (((($scope.get('RSpec')).$$scope.get('Mocks'))).$$scope.get('TestDouble'))['$==='](self.method_double.$object())) !== nil && (!$a.$$is_boolean || $a == true))) { return self.error_generator.$raise_only_valid_on_a_partial_mock("and_call_original") } else { if ((($a = self.$implementation().$inner_action()) !== nil && (!$a.$$is_boolean || $a == true))) { $scope.get('RSpec').$warning("You're overriding a previous implementation for this stub")}; self.implementation = $scope.get('AndCallOriginalImplementation').$new(self.method_double.$original_method()); return self.yield_receiver_to_implementation_block = false; }; }; def.$and_raise = function(exception, message) { var $a, $b, $c, $d, TMP_4, self = this; if (exception == null) { exception = $scope.get('RuntimeError') } if (message == null) { message = nil } if ((($a = exception['$respond_to?']("exception")) !== nil && (!$a.$$is_boolean || $a == true))) { exception = (function() {if (message !== false && message !== nil) { return exception.$exception(message) } else { return exception.$exception() }; return nil; })()}; (($a = [($c = ($d = $scope.get('Proc')).$new, $c.$$p = (TMP_4 = function(){var self = TMP_4.$$s || this; return self.$raise(exception)}, TMP_4.$$s = self, TMP_4), $c).call($d)]), $b = self, $b['$terminal_implementation_action='].apply($b, $a), $a[$a.length-1]); return nil; }; def.$and_throw = function(args) { var $a, $b, $c, $d, TMP_5, self = this; args = $slice.call(arguments, 0); (($a = [($c = ($d = $scope.get('Proc')).$new, $c.$$p = (TMP_5 = function(){var self = TMP_5.$$s || this, $a; return ($a = self).$throw.apply($a, [].concat(args))}, TMP_5.$$s = self, TMP_5), $c).call($d)]), $b = self, $b['$terminal_implementation_action='].apply($b, $a), $a[$a.length-1]); return nil; }; def.$and_yield = TMP_6 = function(args) { var $a, $b, self = this, $iter = TMP_6.$$p, block = $iter || nil; args = $slice.call(arguments, 0); TMP_6.$$p = null; if (block !== false && block !== nil) { if ($opal.$yield1(block, self.eval_context = $scope.get('Object').$new()) === $breaker) return $breaker.$v}; self.args_to_yield['$<<'](args); (($a = [$scope.get('AndYieldImplementation').$new(self.args_to_yield, self.eval_context, self.error_generator)]), $b = self, $b['$initial_implementation_action='].apply($b, $a), $a[$a.length-1]); return self; }; def['$matches?'] = function(message, args) { var $a, $b, self = this; args = $slice.call(arguments, 1); return (($a = self.message['$=='](message)) ? ($b = self.argument_list_matcher)['$args_match?'].apply($b, [].concat(args)) : $a); }; def.$invoke = TMP_7 = function(parent_stub, args) { var $a, $b, $c, $d, self = this, $iter = TMP_7.$$p, block = $iter || nil; args = $slice.call(arguments, 1); TMP_7.$$p = null; if ((($a = self['$yield_receiver_to_implementation_block?']()) !== nil && (!$a.$$is_boolean || $a == true))) { args.$unshift(self.$orig_object())}; if ((($a = ((($b = self['$negative?']()) !== false && $b !== nil) ? $b : (($c = (((($d = self.exactly) !== false && $d !== nil) ? $d : self.at_most)), $c !== false && $c !== nil ?(self.actual_received_count['$=='](self.expected_received_count)) : $c)))) !== nil && (!$a.$$is_boolean || $a == true))) { self.actual_received_count = self.actual_received_count['$+'](1); self.failed_fast = true; ($a = self.error_generator).$raise_expectation_error.apply($a, [self.message, self.expected_received_count, self.argument_list_matcher, self.actual_received_count, self.$expectation_count_type()].concat(args));}; self.order_group.$handle_order_constraint(self); try { if ((($b = self.$implementation()['$present?']()) !== nil && (!$b.$$is_boolean || $b == true))) { return ($b = ($c = self.$implementation()).$call, $b.$$p = block.$to_proc(), $b).apply($c, [].concat(args)) } else if (parent_stub !== false && parent_stub !== nil) { return ($b = ($d = parent_stub).$invoke, $b.$$p = block.$to_proc(), $b).apply($d, [nil].concat(args)) } else { return nil } } finally { self.actual_received_count = self.actual_received_count['$+'](1) }; }; def['$negative?'] = function() { var $a, self = this; return (($a = self.expected_received_count['$=='](0)) ? self.at_least['$!']() : $a); }; def['$called_max_times?'] = function() { var $a, $b, $c, self = this; return ($a = ($b = ($c = self.expected_received_count['$==']("any")['$!'](), $c !== false && $c !== nil ?self.at_least['$!']() : $c), $b !== false && $b !== nil ?self.expected_received_count['$>'](0) : $b), $a !== false && $a !== nil ?self.actual_received_count['$>='](self.expected_received_count) : $a); }; def.$matches_name_but_not_args = function(message, args) { var $a, $b, self = this; args = $slice.call(arguments, 1); return (($a = self.message['$=='](message)) ? ($b = self.argument_list_matcher)['$args_match?'].apply($b, [].concat(args))['$!']() : $a); }; def.$verify_messages_received = function() { var $a, $b, TMP_8, self = this; return ($a = ($b = $scope.get('InsertOntoBacktrace')).$line, $a.$$p = (TMP_8 = function(){var self = TMP_8.$$s || this, $a, $b; if ((($a = ((($b = self['$expected_messages_received?']()) !== false && $b !== nil) ? $b : self['$failed_fast?']())) !== nil && (!$a.$$is_boolean || $a == true))) { return nil } else { return self.$generate_error() }}, TMP_8.$$s = self, TMP_8), $a).call($b, self.expected_from); }; def['$expected_messages_received?'] = function() { var $a, $b, $c, self = this; return ((($a = ((($b = ((($c = self['$ignoring_args?']()) !== false && $c !== nil) ? $c : self['$matches_exact_count?']())) !== false && $b !== nil) ? $b : self['$matches_at_least_count?']())) !== false && $a !== nil) ? $a : self['$matches_at_most_count?']()); }; def['$ensure_expected_ordering_received!'] = function() { var $a, self = this; if ((($a = self.ordered) !== nil && (!$a.$$is_boolean || $a == true))) { self.order_group.$verify_invocation_order(self)}; return true; }; def['$ignoring_args?'] = function() { var self = this; return self.expected_received_count['$==']("any"); }; def['$matches_at_least_count?'] = function() { var $a, self = this; return ($a = self.at_least, $a !== false && $a !== nil ?self.actual_received_count['$>='](self.expected_received_count) : $a); }; def['$matches_at_most_count?'] = function() { var $a, self = this; return ($a = self.at_most, $a !== false && $a !== nil ?self.actual_received_count['$<='](self.expected_received_count) : $a); }; def['$matches_exact_count?'] = function() { var self = this; return self.expected_received_count['$=='](self.actual_received_count); }; def.$similar_messages = function() { var $a, self = this; return ((($a = self.similar_messages) !== false && $a !== nil) ? $a : self.similar_messages = []); }; def.$advise = function(args) { var self = this; args = $slice.call(arguments, 0); return self.$similar_messages()['$<<'](args); }; def.$generate_error = function() { var $a, $b, self = this; if ((($a = self.$similar_messages()['$empty?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return ($a = self.error_generator).$raise_expectation_error.apply($a, [self.message, self.expected_received_count, self.argument_list_matcher, self.actual_received_count, self.$expectation_count_type()].concat(self.$expected_args())) } else { return ($b = self.error_generator).$raise_similar_message_args_error.apply($b, [self].concat(self.similar_messages)) }; }; def.$expectation_count_type = function() { var $a, self = this; if ((($a = self.at_least) !== nil && (!$a.$$is_boolean || $a == true))) { return "at_least"}; if ((($a = self.at_most) !== nil && (!$a.$$is_boolean || $a == true))) { return "at_most"}; return nil; }; def.$description = function() { var $a, self = this; return ($a = self.error_generator).$describe_expectation.apply($a, [self.message, self.expected_received_count, self.actual_received_count].concat(self.$expected_args())); }; def.$raise_out_of_order_error = function() { var self = this; return self.error_generator.$raise_out_of_order_error(self.message); }; def.$with = TMP_9 = function(args) { var $a, $b, self = this, $iter = TMP_9.$$p, block = $iter || nil; args = $slice.call(arguments, 0); TMP_9.$$p = null; if ((($a = args['$empty?']()) !== nil && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('ArgumentError'), "`with` must have at least one argument. Use `no_args` matcher to set the expectation of receiving no arguments.")}; (($a = [block]), $b = self, $b['$inner_implementation_action='].apply($b, $a), $a[$a.length-1]); self.argument_list_matcher = ($a = $scope.get('ArgumentListMatcher')).$new.apply($a, [].concat(args)); return self; }; def.$exactly = TMP_10 = function(n) { var $a, $b, self = this, $iter = TMP_10.$$p, block = $iter || nil; TMP_10.$$p = null; (($a = [block]), $b = self, $b['$inner_implementation_action='].apply($b, $a), $a[$a.length-1]); self.$set_expected_received_count("exactly", n); return self; }; def.$at_least = TMP_11 = function(n) { var $a, $b, self = this, $iter = TMP_11.$$p, block = $iter || nil; TMP_11.$$p = null; self.$set_expected_received_count("at_least", n); if (n['$=='](0)) { self.$raise("at_least(0) has been removed, use allow(...).to receive(:message) instead")}; (($a = [block]), $b = self, $b['$inner_implementation_action='].apply($b, $a), $a[$a.length-1]); return self; }; def.$at_most = TMP_12 = function(n) { var $a, $b, self = this, $iter = TMP_12.$$p, block = $iter || nil; TMP_12.$$p = null; (($a = [block]), $b = self, $b['$inner_implementation_action='].apply($b, $a), $a[$a.length-1]); self.$set_expected_received_count("at_most", n); return self; }; def.$times = TMP_13 = function() { var $a, $b, self = this, $iter = TMP_13.$$p, block = $iter || nil; TMP_13.$$p = null; (($a = [block]), $b = self, $b['$inner_implementation_action='].apply($b, $a), $a[$a.length-1]); return self; }; def.$never = function() { var $a, self = this; if ((($a = self['$negative?']()) !== nil && (!$a.$$is_boolean || $a == true))) { $scope.get('ErrorGenerator').$raise_double_negation_error("expect(obj)")}; self.expected_received_count = 0; return self; }; def.$once = TMP_14 = function() { var $a, $b, self = this, $iter = TMP_14.$$p, block = $iter || nil; TMP_14.$$p = null; (($a = [block]), $b = self, $b['$inner_implementation_action='].apply($b, $a), $a[$a.length-1]); self.$set_expected_received_count("exactly", 1); return self; }; def.$twice = TMP_15 = function() { var $a, $b, self = this, $iter = TMP_15.$$p, block = $iter || nil; TMP_15.$$p = null; (($a = [block]), $b = self, $b['$inner_implementation_action='].apply($b, $a), $a[$a.length-1]); self.$set_expected_received_count("exactly", 2); return self; }; def.$ordered = TMP_16 = function() { var $a, $b, self = this, $iter = TMP_16.$$p, block = $iter || nil; TMP_16.$$p = null; (($a = [block]), $b = self, $b['$inner_implementation_action='].apply($b, $a), $a[$a.length-1]); self.ordered = true; return self; }; def['$ordered?'] = function() { var self = this; return self.ordered; }; def['$negative_expectation_for?'] = function(message) { var $a, self = this; return (($a = self.message['$=='](message)) ? self['$negative?']() : $a); }; def['$actual_received_count_matters?'] = function() { var $a, $b, self = this; return ((($a = ((($b = self.at_least) !== false && $b !== nil) ? $b : self.at_most)) !== false && $a !== nil) ? $a : self.exactly); }; def['$increase_actual_received_count!'] = function() { var self = this; return self.actual_received_count = self.actual_received_count['$+'](1); }; self.$private(); def['$failed_fast?'] = function() { var self = this; return self.failed_fast; }; def.$set_expected_received_count = function(relativity, n) { var self = this, $case = nil; self.at_least = (relativity['$==']("at_least")); self.at_most = (relativity['$==']("at_most")); self.exactly = (relativity['$==']("exactly")); return self.expected_received_count = (function() {$case = n;if ($scope.get('Numeric')['$===']($case)) {return n}else if ("once"['$===']($case)) {return 1}else if ("twice"['$===']($case)) {return 2}else { return nil }})(); }; def['$initial_implementation_action='] = function(action) { var $a, $b, self = this; return (($a = [action]), $b = self.$implementation(), $b['$initial_action='].apply($b, $a), $a[$a.length-1]); }; def['$inner_implementation_action='] = function(action) { var $a, $b, self = this; if ((($a = self.$implementation().$inner_action()) !== nil && (!$a.$$is_boolean || $a == true))) { $scope.get('RSpec').$warning("You're overriding a previous implementation for this stub")}; if (action !== false && action !== nil) { return (($a = [action]), $b = self.$implementation(), $b['$inner_action='].apply($b, $a), $a[$a.length-1]) } else { return nil }; }; return (def['$terminal_implementation_action='] = function(action) { var $a, $b, self = this; return (($a = [action]), $b = self.$implementation(), $b['$terminal_action='].apply($b, $a), $a[$a.length-1]); }, nil) && 'terminal_implementation_action='; })(self, null); (function($base, $super) { function $AndYieldImplementation(){}; var self = $AndYieldImplementation = $klass($base, $super, 'AndYieldImplementation', $AndYieldImplementation); var def = self.$$proto, $scope = self.$$scope, TMP_17; def.args_to_yield = def.eval_context = def.error_generator = nil; def.$initialize = function(args_to_yield, eval_context, error_generator) { var self = this; self.args_to_yield = args_to_yield; self.eval_context = eval_context; return self.error_generator = error_generator; }; return (def.$call = TMP_17 = function(args_to_ignore) { var $a, $b, TMP_18, self = this, $iter = TMP_17.$$p, block = $iter || nil, value = nil; args_to_ignore = $slice.call(arguments, 0); TMP_17.$$p = null; if ((($a = ($b = self.args_to_yield['$empty?'](), $b !== false && $b !== nil ?self.eval_context['$nil?']() : $b)) !== nil && (!$a.$$is_boolean || $a == true))) { return nil}; if (block !== false && block !== nil) { } else { self.error_generator.$raise_missing_block_error(self.args_to_yield) }; value = nil; ($a = ($b = self.args_to_yield).$each, $a.$$p = (TMP_18 = function(args){var self = TMP_18.$$s || this, $a, $b; if (self.error_generator == null) self.error_generator = nil; if (self.eval_context == null) self.eval_context = nil; if (args == null) args = nil; if ((($a = (($b = block.$arity()['$>'](-1)) ? args.$length()['$=='](block.$arity())['$!']() : $b)) !== nil && (!$a.$$is_boolean || $a == true))) { self.error_generator.$raise_wrong_arity_error(args, block.$arity())}; return value = (function() {if ((($a = self.eval_context) !== nil && (!$a.$$is_boolean || $a == true))) { return ($a = ($b = self.eval_context).$instance_exec, $a.$$p = block.$to_proc(), $a).apply($b, [].concat(args)) } else { return ($a = block).$call.apply($a, [].concat(args)) }; return nil; })();}, TMP_18.$$s = self, TMP_18), $a).call($b); return value; }, nil) && 'call'; })(self, null); (function($base, $super) { function $AndReturnImplementation(){}; var self = $AndReturnImplementation = $klass($base, $super, 'AndReturnImplementation', $AndReturnImplementation); var def = self.$$proto, $scope = self.$$scope, TMP_19; def.values_to_return = nil; def.$initialize = function(values_to_return) { var self = this; return self.values_to_return = values_to_return; }; return (def.$call = TMP_19 = function(args_to_ignore) { var self = this, $iter = TMP_19.$$p, block = $iter || nil; args_to_ignore = $slice.call(arguments, 0); TMP_19.$$p = null; if (self.values_to_return.$size()['$>'](1)) { return self.values_to_return.$shift() } else { return self.values_to_return.$first() }; }, nil) && 'call'; })(self, null); (function($base, $super) { function $Implementation(){}; var self = $Implementation = $klass($base, $super, 'Implementation', $Implementation); var def = self.$$proto, $scope = self.$$scope, TMP_20; self.$attr_accessor("initial_action", "inner_action", "terminal_action"); def.$call = TMP_20 = function(args) { var $a, $b, TMP_21, self = this, $iter = TMP_20.$$p, block = $iter || nil; args = $slice.call(arguments, 0); TMP_20.$$p = null; return ($a = ($b = self.$actions()).$map, $a.$$p = (TMP_21 = function(action){var self = TMP_21.$$s || this, $a, $b; if (action == null) action = nil; return ($a = ($b = action).$call, $a.$$p = block.$to_proc(), $a).apply($b, [].concat(args))}, TMP_21.$$s = self, TMP_21), $a).call($b).$last(); }; def['$present?'] = function() { var self = this; return self.$actions()['$any?'](); }; self.$private(); return (def.$actions = function() { var self = this; return [self.$initial_action(), self.$inner_action(), self.$terminal_action()].$compact(); }, nil) && 'actions'; })(self, null); (function($base, $super) { function $AndCallOriginalImplementation(){}; var self = $AndCallOriginalImplementation = $klass($base, $super, 'AndCallOriginalImplementation', $AndCallOriginalImplementation); var def = self.$$proto, $scope = self.$$scope, TMP_22; def.method = nil; def.$initialize = function(method) { var self = this; return self.method = method; }; $opal.cdecl($scope, 'CannotModifyFurtherError', $scope.get('Class').$new($scope.get('StandardError'))); def['$initial_action='] = function(value) { var self = this; return self.$raise(self.$cannot_modify_further_error()); }; def['$inner_action='] = function(value) { var self = this; return self.$raise(self.$cannot_modify_further_error()); }; def['$terminal_action='] = function(value) { var self = this; return self.$raise(self.$cannot_modify_further_error()); }; def['$present?'] = function() { var self = this; return true; }; def.$inner_action = function() { var self = this; return true; }; def.$call = TMP_22 = function(args) { var $a, $b, self = this, $iter = TMP_22.$$p, block = $iter || nil; args = $slice.call(arguments, 0); TMP_22.$$p = null; return ($a = ($b = self.method).$call, $a.$$p = block.$to_proc(), $a).apply($b, [].concat(args)); }; self.$private(); return (def.$cannot_modify_further_error = function() { var self = this; return $scope.get('CannotModifyFurtherError').$new("This method has already been configured "['$+']("to call the original implementation, and cannot be modified further.")); }, nil) && 'cannot_modify_further_error'; })(self, null); (function($base, $super) { function $InsertOntoBacktrace(){}; var self = $InsertOntoBacktrace = $klass($base, $super, 'InsertOntoBacktrace', $InsertOntoBacktrace); var def = self.$$proto, $scope = self.$$scope, TMP_23; return ($opal.defs(self, '$line', TMP_23 = function(location) { var $a, self = this, $iter = TMP_23.$$p, $yield = $iter || nil, error = nil; TMP_23.$$p = null; try { return $a = $opal.$yieldX($yield, []), $a === $breaker ? $a : $a } catch ($err) {if ($opal.$rescue($err, [(((($scope.get('RSpec')).$$scope.get('Mocks'))).$$scope.get('MockExpectationError'))])) {error = $err; error.$backtrace().$insert(0, location); return $scope.get('Kernel').$raise(error); }else { throw $err; } }; }), nil) && 'line' })(self, null); })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/mocks/method_double"] = 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(['$attr_reader', '$new', '$original_method', '$method_handle_for', '$method_name', '$__send__', '$to_proc', '$alias_method', '$===', '$private_method_defined?', '$object_singleton_class', '$protected_method_defined?', '$visibility', '$stash', '$define_proxy_method', '$save_original_method!', '$class_exec', '$define_method', '$proxy_method_invoked', '$message_received', '$method_is_stashed?', '$restore', '$restore_original_visibility', '$method_defined?', '$each', '$verify_messages_received', '$expectations', '$restore_original_method', '$clear', '$stubs', '$configure_method', '$message_expectation_class', '$<<', '$unshift', '$setup_simple_method_double', '$any?', '$add_stub', '$empty?', '$raise_method_not_stubbed_error', '$reset', '$delete', '$raise']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Mocks'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $MethodDouble(){}; var self = $MethodDouble = $klass($base, $super, 'MethodDouble', $MethodDouble); var def = self.$$proto, $scope = self.$$scope, TMP_4, TMP_6, TMP_7, TMP_8; def.original_method = def.method_stasher = def.proxy = def.object = def.method_name = def.method_is_proxied = def.original_visibility = nil; self.$attr_reader("method_name", "object", "expectations", "stubs"); def.$initialize = function(object, method_name, proxy) { var self = this; self.method_name = method_name; self.object = object; self.proxy = proxy; self.original_visibility = nil; self.method_stasher = $scope.get('InstanceMethodStasher').$new(object, method_name); self.method_is_proxied = false; self.expectations = []; return self.stubs = []; }; def.$original_method = function() { var $a, $b, $c, $d, TMP_1, self = this; return ((($a = self.original_method) !== false && $a !== nil) ? $a : self.original_method = ((($b = ((($c = self.method_stasher.$original_method()) !== false && $c !== nil) ? $c : self.proxy.$method_handle_for(self.$method_name()))) !== false && $b !== nil) ? $b : ($c = ($d = $scope.get('Proc')).$new, $c.$$p = (TMP_1 = function(args){var self = TMP_1.$$s || this, block, $a, $b; if (self.object == null) self.object = nil; if (self.method_name == null) self.method_name = nil; args = $slice.call(arguments, 0); block = TMP_1.$$p || nil, TMP_1.$$p = null; return ($a = ($b = self.object).$__send__, $a.$$p = block.$to_proc(), $a).apply($b, ["method_missing", self.method_name].concat(args))}, TMP_1.$$s = self, TMP_1), $c).call($d))); }; self.$alias_method("save_original_method!", "original_method"); def.$visibility = function() { var $a, self = this; if ((($a = $scope.get('TestDouble')['$==='](self.object)) !== nil && (!$a.$$is_boolean || $a == true))) { return "public" } else if ((($a = self.$object_singleton_class()['$private_method_defined?'](self.method_name)) !== nil && (!$a.$$is_boolean || $a == true))) { return "private" } else if ((($a = self.$object_singleton_class()['$protected_method_defined?'](self.method_name)) !== nil && (!$a.$$is_boolean || $a == true))) { return "protected" } else { return "public" }; }; def.$object_singleton_class = function() { var self = this; return (function(self) { var $scope = self.$$scope, def = self.$$proto; return self })(self.object.$singleton_class()); }; def.$configure_method = function() { var $a, self = this; self.original_visibility = [self.$visibility(), self.$method_name()]; if ((($a = self.method_is_proxied) !== nil && (!$a.$$is_boolean || $a == true))) { } else { self.method_stasher.$stash() }; return self.$define_proxy_method(); }; def.$define_proxy_method = function() { var $a, $b, TMP_2, self = this; if ((($a = self.method_is_proxied) !== nil && (!$a.$$is_boolean || $a == true))) { return nil}; self['$save_original_method!'](); ($a = ($b = self.$object_singleton_class()).$class_exec, $a.$$p = (TMP_2 = function(method_double, method_name, visibility){var self = TMP_2.$$s || this, $a, $b, TMP_3; if (method_double == null) method_double = nil;if (method_name == null) method_name = nil;if (visibility == null) visibility = nil; ($a = ($b = self).$define_method, $a.$$p = (TMP_3 = function(args){var self = TMP_3.$$s || this, block, $a, $b; args = $slice.call(arguments, 0); block = TMP_3.$$p || nil, TMP_3.$$p = null; return ($a = ($b = method_double).$proxy_method_invoked, $a.$$p = block.$to_proc(), $a).apply($b, [self].concat(args))}, TMP_3.$$s = self, TMP_3), $a).call($b, method_name); return self.$__send__(visibility, method_name);}, TMP_2.$$s = self, TMP_2), $a).call($b, self, self.$method_name(), self.$visibility()); return self.method_is_proxied = true; }; def.$proxy_method_invoked = TMP_4 = function(obj, args) { var $a, $b, self = this, $iter = TMP_4.$$p, block = $iter || nil; args = $slice.call(arguments, 1); TMP_4.$$p = null; return ($a = ($b = self.proxy).$message_received, $a.$$p = block.$to_proc(), $a).apply($b, [self.$method_name()].concat(args)); }; def.$restore_original_method = function() { var $a, self = this; if ((($a = self.method_is_proxied) !== nil && (!$a.$$is_boolean || $a == true))) { } else { return nil }; self.$object_singleton_class().$__send__("remove_method", self.method_name); if ((($a = self.method_stasher['$method_is_stashed?']()) !== nil && (!$a.$$is_boolean || $a == true))) { self.method_stasher.$restore()}; self.$restore_original_visibility(); return self.method_is_proxied = false; }; def.$restore_original_visibility = function() { var $a, $b, $c, self = this; if ((($a = ($b = self.original_visibility, $b !== false && $b !== nil ?(((($c = self.$object_singleton_class()['$method_defined?'](self.method_name)) !== false && $c !== nil) ? $c : self.$object_singleton_class()['$private_method_defined?'](self.method_name))) : $b)) !== nil && (!$a.$$is_boolean || $a == true))) { } else { return nil }; return ($a = self.$object_singleton_class()).$__send__.apply($a, [].concat(self.original_visibility)); }; def.$verify = function() { var $a, $b, TMP_5, self = this; return ($a = ($b = self.$expectations()).$each, $a.$$p = (TMP_5 = function(e){var self = TMP_5.$$s || this; if (e == null) e = nil; return e.$verify_messages_received()}, TMP_5.$$s = self, TMP_5), $a).call($b); }; def.$reset = function() { var self = this; self.$restore_original_method(); return self.$clear(); }; def.$clear = function() { var self = this; self.$expectations().$clear(); return self.$stubs().$clear(); }; def.$message_expectation_class = function() { var self = this; return $scope.get('MessageExpectation'); }; def.$add_expectation = TMP_6 = function(error_generator, expectation_ordering, expected_from, opts) { var $a, $b, self = this, $iter = TMP_6.$$p, implementation = $iter || nil, expectation = nil; TMP_6.$$p = null; self.$configure_method(); expectation = ($a = ($b = self.$message_expectation_class()).$new, $a.$$p = implementation.$to_proc(), $a).call($b, error_generator, expectation_ordering, expected_from, self, 1, opts); self.$expectations()['$<<'](expectation); return expectation; }; def.$build_expectation = function(error_generator, expectation_ordering) { var self = this, expected_from = nil; expected_from = $scope.get('IGNORED_BACKTRACE_LINE'); return self.$message_expectation_class().$new(error_generator, expectation_ordering, expected_from, self); }; def.$add_stub = TMP_7 = function(error_generator, expectation_ordering, expected_from, opts) { var $a, $b, self = this, $iter = TMP_7.$$p, implementation = $iter || nil, stub = nil; if (opts == null) { opts = $hash2([], {}) } TMP_7.$$p = null; self.$configure_method(); stub = ($a = ($b = self.$message_expectation_class()).$new, $a.$$p = implementation.$to_proc(), $a).call($b, error_generator, expectation_ordering, expected_from, self, "any", opts); self.$stubs().$unshift(stub); return stub; }; def.$add_simple_stub = function(method_name, response) { var self = this; return self.$setup_simple_method_double(method_name, response, self.$stubs()); }; def.$add_simple_expectation = function(method_name, response, error_generator, backtrace_line) { var self = this; return self.$setup_simple_method_double(method_name, response, self.$expectations(), error_generator, backtrace_line); }; def.$setup_simple_method_double = function(method_name, response, collection, error_generator, backtrace_line) { var self = this, me = nil; if (error_generator == null) { error_generator = nil } if (backtrace_line == null) { backtrace_line = nil } self.$define_proxy_method(); me = $scope.get('SimpleMessageExpectation').$new(method_name, response, error_generator, backtrace_line); collection.$unshift(me); return me; }; def.$add_default_stub = TMP_8 = function(args) { var $a, $b, self = this, $iter = TMP_8.$$p, implementation = $iter || nil; args = $slice.call(arguments, 0); TMP_8.$$p = null; if ((($a = self.$stubs()['$any?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return nil}; return ($a = ($b = self).$add_stub, $a.$$p = implementation.$to_proc(), $a).apply($b, [].concat(args)); }; def.$remove_stub = function() { var $a, self = this; if ((($a = self.$stubs()['$empty?']()) !== nil && (!$a.$$is_boolean || $a == true))) { self.$raise_method_not_stubbed_error()}; if ((($a = self.$expectations()['$empty?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return self.$reset() } else { return self.$stubs().$clear() }; }; def.$remove_single_stub = function(stub) { var $a, $b, self = this; self.$stubs().$delete(stub); if ((($a = ($b = self.$stubs()['$empty?'](), $b !== false && $b !== nil ?self.$expectations()['$empty?']() : $b)) !== nil && (!$a.$$is_boolean || $a == true))) { return self.$restore_original_method() } else { return nil }; }; def.$raise_method_not_stubbed_error = function() { var self = this; return self.$raise($scope.get('MockExpectationError'), "The method `" + (self.$method_name()) + "` was not stubbed or was already unstubbed"); }; return $opal.cdecl($scope, 'IGNORED_BACKTRACE_LINE', "this backtrace line is ignored"); })(self, null) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/mocks/method_reference"] = 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(['$when_loaded', '$method_implemented?', '$method_defined?', '$original_method', '$implemented?', '$private', '$defined?', '$find_method', '$==', '$<', '$to_i', '$[]', '$split', '$instance_method', '$dup', '$respond_to?', '$method']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Mocks'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $MethodReference(){}; var self = $MethodReference = $klass($base, $super, 'MethodReference', $MethodReference); var def = self.$$proto, $scope = self.$$scope, TMP_3, TMP_4; def.module_reference = nil; def.$initialize = function(module_reference, method_name) { var self = this; self.module_reference = module_reference; return self.method_name = method_name; }; def['$implemented?'] = function() { var $a, $b, TMP_1, self = this; return ($a = ($b = self.module_reference).$when_loaded, $a.$$p = (TMP_1 = function(m){var self = TMP_1.$$s || this; if (m == null) m = nil; return self['$method_implemented?'](m)}, TMP_1.$$s = self, TMP_1), $a).call($b); }; def['$defined?'] = function() { var $a, $b, TMP_2, self = this; return ($a = ($b = self.module_reference).$when_loaded, $a.$$p = (TMP_2 = function(m){var self = TMP_2.$$s || this; if (m == null) m = nil; return self['$method_defined?'](m)}, TMP_2.$$s = self, TMP_2), $a).call($b); }; def.$when_defined = TMP_3 = function() { var $a, self = this, $iter = TMP_3.$$p, $yield = $iter || nil, original = nil; TMP_3.$$p = null; if ((($a = original = self.$original_method()) !== nil && (!$a.$$is_boolean || $a == true))) { return $a = $opal.$yield1($yield, original), $a === $breaker ? $a : $a } else { return nil }; }; def.$when_unimplemented = TMP_4 = function() { var $a, self = this, $iter = TMP_4.$$p, $yield = $iter || nil; TMP_4.$$p = null; if ((($a = self['$implemented?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return nil } else { return $a = $opal.$yieldX($yield, []), $a === $breaker ? $a : $a }; }; self.$private(); return (def.$original_method = function() { var $a, $b, TMP_5, self = this; return ($a = ($b = self.module_reference).$when_loaded, $a.$$p = (TMP_5 = function(m){var self = TMP_5.$$s || this, $a; if (m == null) m = nil; return ($a = self['$defined?'](), $a !== false && $a !== nil ?self.$find_method(m) : $a)}, TMP_5.$$s = self, TMP_5), $a).call($b); }, nil) && 'original_method'; })(self, null); (function($base, $super) { function $InstanceMethodReference(){}; var self = $InstanceMethodReference = $klass($base, $super, 'InstanceMethodReference', $InstanceMethodReference); var def = self.$$proto, $scope = self.$$scope, $a, $b; def.method_name = nil; self.$private(); def['$method_implemented?'] = function(m) { var self = this; return m['$method_defined?'](self.method_name); }; $opal.defn(self, '$method_defined?', def['$method_implemented?']); if ((($a = (($b = $scope.get('RUBY_PLATFORM')['$==']("java")) ? $scope.get('JRUBY_VERSION').$split(".")['$[]'](-1).$to_i()['$<'](5) : $b)) !== nil && (!$a.$$is_boolean || $a == true))) { return (def.$find_method = function(m) { var self = this; return m.$dup().$instance_method(self.method_name); }, nil) && 'find_method' } else { return (def.$find_method = function(m) { var self = this; return m.$instance_method(self.method_name); }, nil) && 'find_method' }; })(self, $scope.get('MethodReference')); (function($base, $super) { function $ObjectMethodReference(){}; var self = $ObjectMethodReference = $klass($base, $super, 'ObjectMethodReference', $ObjectMethodReference); var def = self.$$proto, $scope = self.$$scope; def.method_name = nil; self.$private(); def['$method_implemented?'] = function(m) { var self = this; return m['$respond_to?'](self.method_name); }; def['$method_defined?'] = function(m) { var self = this; return ((function(self) { var $scope = self.$$scope, def = self.$$proto; return self })(m.$singleton_class()))['$method_defined?'](self.method_name); }; return (def.$find_method = function(m) { var self = this; return m.$method(self.method_name); }, nil) && 'find_method'; })(self, $scope.get('MethodReference')); })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/mocks/mock"] = 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(['$include']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Mocks'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Mock(){}; var self = $Mock = $klass($base, $super, 'Mock', $Mock); var def = self.$$proto, $scope = self.$$scope; return self.$include($scope.get('TestDouble')) })(self, null) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/mocks/mutate_const"] = 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, $hash = $opal.hash; $opal.add_stubs(['$==', '$arity', '$method', '$const_defined?', '$const_defined_on?', '$const_get', '$raise', '$name', '$select', '$constants', '$inject', '$get_const_defined_on', '$split', '$normalize_const_name', '$!', '$===', '$join', '$sub', '$extend', '$attr_reader', '$attr_accessor', '$attr_writer', '$class', '$new', '$previously_defined=', '$recursive_const_defined?', '$stubbed=', '$hidden=', '$previously_defined?', '$original_value=', '$recursive_const_get', '$private_class_method', '$find', '$to_constant', '$unmutated', '$to_proc', '$raise_on_invalid_const', '$mutate', '$fetch', '$transfer_nested_constants?', '$configuration', '$include', '$pop', '$full_constant_name', '$original_value', '$__send__', '$const_set', '$verify_constants_to_transfer!', '$transfer_nested_constants', '$each', '$respond_to?', '$+', '$map', '$-', '$constants_defined_on', '$any?', '$dup', '$shift', '$first', '$register_mutator', '$rspec_reset', '$reverse', '$mutators', '$clear', '$<<', '$lambda']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Mocks'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'RecursiveConstMethods'); var def = self.$$proto, $scope = self.$$scope, TMP_4; if ($scope.get('Module').$method("const_defined?").$arity()['$=='](1)) { def['$const_defined_on?'] = function(mod, const_name) { var self = this; return mod['$const_defined?'](const_name); }; def.$get_const_defined_on = function(mod, const_name) { var $a, self = this; if ((($a = self['$const_defined_on?'](mod, const_name)) !== nil && (!$a.$$is_boolean || $a == true))) { return mod.$const_get(const_name)}; return self.$raise($scope.get('NameError'), "uninitialized constant " + (mod.$name()) + "::" + (const_name)); }; def.$constants_defined_on = function(mod) { var $a, $b, TMP_1, self = this; return ($a = ($b = mod.$constants()).$select, $a.$$p = (TMP_1 = function(c){var self = TMP_1.$$s || this; if (c == null) c = nil; return self['$const_defined_on?'](mod, c)}, TMP_1.$$s = self, TMP_1), $a).call($b); }; } else { def['$const_defined_on?'] = function(mod, const_name) { var self = this; return mod['$const_defined?'](const_name, false); }; def.$get_const_defined_on = function(mod, const_name) { var self = this; return mod.$const_get(const_name, false); }; def.$constants_defined_on = function(mod) { var self = this; return mod.$constants(false); }; }; def.$recursive_const_get = function(const_name) { var $a, $b, TMP_2, self = this; return ($a = ($b = self.$normalize_const_name(const_name).$split("::")).$inject, $a.$$p = (TMP_2 = function(mod, name){var self = TMP_2.$$s || this; if (mod == null) mod = nil;if (name == null) name = nil; return self.$get_const_defined_on(mod, name)}, TMP_2.$$s = self, TMP_2), $a).call($b, $scope.get('Object')); }; def['$recursive_const_defined?'] = TMP_4 = function(const_name) {try { var $a, $b, TMP_3, self = this, $iter = TMP_4.$$p, $yield = $iter || nil; TMP_4.$$p = null; return ($a = ($b = self.$normalize_const_name(const_name).$split("::")).$inject, $a.$$p = (TMP_3 = function($c, name){var self = TMP_3.$$s || this, $a, $b; mod = $c[0];full_name = $c[1];if (name == null) name = nil; if ((($a = (($b = ($yield !== nil)) ? ($scope.get('Module')['$==='](mod))['$!']() : $b)) !== nil && (!$a.$$is_boolean || $a == true))) { if ($opal.$yieldX($yield, [full_name, name]) === $breaker) return $breaker.$v}; if ((($a = self['$const_defined_on?'](mod, name)) !== nil && (!$a.$$is_boolean || $a == true))) { } else { $opal.$return(false) }; return [self.$get_const_defined_on(mod, name), [mod, name].$join("::")];}, TMP_3.$$s = self, TMP_3), $a).call($b, [$scope.get('Object'), ""]); } catch ($returner) { if ($returner === $opal.returner) { return $returner.$v } throw $returner; } }; def.$normalize_const_name = function(const_name) { var self = this; return const_name.$sub(/\A::/, ""); }; ;$opal.donate(self, ["$const_defined_on?", "$get_const_defined_on", "$constants_defined_on", "$const_defined_on?", "$get_const_defined_on", "$constants_defined_on", "$recursive_const_get", "$recursive_const_defined?", "$normalize_const_name"]); })(self); (function($base, $super) { function $Constant(){}; var self = $Constant = $klass($base, $super, 'Constant', $Constant); var def = self.$$proto, $scope = self.$$scope; def.previously_defined = def.stubbed = def.hidden = nil; self.$extend($scope.get('RecursiveConstMethods')); def.$initialize = function(name) { var self = this; self.name = name; self.previously_defined = false; self.stubbed = false; return self.hidden = false; }; self.$attr_reader("name"); self.$attr_accessor("original_value"); self.$attr_writer("previously_defined", "stubbed", "hidden"); def['$previously_defined?'] = function() { var self = this; return self.previously_defined; }; def['$mutated?'] = function() { var $a, self = this; return ((($a = self.stubbed) !== false && $a !== nil) ? $a : self.hidden); }; def['$stubbed?'] = function() { var self = this; return self.stubbed; }; def['$hidden?'] = function() { var self = this; return self.hidden; }; def.$to_s = function() { var self = this; return "#<" + (self.$class().$name()) + " " + (self.$name()) + ">"; }; $opal.defn(self, '$inspect', def.$to_s); $opal.defs(self, '$unmutated', function(name) { var $a, $b, self = this, const$ = nil; const$ = self.$new(name); (($a = [self['$recursive_const_defined?'](name)]), $b = const$, $b['$previously_defined='].apply($b, $a), $a[$a.length-1]); (($a = [false]), $b = const$, $b['$stubbed='].apply($b, $a), $a[$a.length-1]); (($a = [false]), $b = const$, $b['$hidden='].apply($b, $a), $a[$a.length-1]); if ((($a = const$['$previously_defined?']()) !== nil && (!$a.$$is_boolean || $a == true))) { (($a = [self.$recursive_const_get(name)]), $b = const$, $b['$original_value='].apply($b, $a), $a[$a.length-1])}; return const$; }); self.$private_class_method("unmutated"); return ($opal.defs(self, '$original', function(name) { var self = this, mutator = nil; mutator = $scope.get('ConstantMutator').$find(name); if (mutator !== false && mutator !== nil) { return mutator.$to_constant() } else { return self.$unmutated(name) }; }), nil) && 'original'; })(self, null); (function($base, $super) { function $ConstantMutator(){}; var self = $ConstantMutator = $klass($base, $super, 'ConstantMutator', $ConstantMutator); var def = self.$$proto, $scope = self.$$scope; self.$extend($scope.get('RecursiveConstMethods')); $opal.defs(self, '$stub', function(constant_name, value, options) { var $a, $b, $c, self = this, mutator = nil; if (options == null) { options = $hash2([], {}) } mutator = (function() {if ((($a = ($b = ($c = self)['$recursive_const_defined?'], $b.$$p = self.$raise_on_invalid_const().$to_proc(), $b).call($c, constant_name)) !== nil && (!$a.$$is_boolean || $a == true))) { return $scope.get('DefinedConstantReplacer') } else { return $scope.get('UndefinedConstantSetter') }; return nil; })(); self.$mutate(mutator.$new(constant_name, value, options.$fetch("transfer_nested_constants", (($scope.get('RSpec')).$$scope.get('Mocks')).$configuration()['$transfer_nested_constants?']()))); return value; }); $opal.defs(self, '$hide', function(constant_name) { var $a, self = this; if ((($a = self['$recursive_const_defined?'](constant_name)) !== nil && (!$a.$$is_boolean || $a == true))) { } else { return nil }; self.$mutate($scope.get('ConstantHider').$new(constant_name, nil, $hash2([], {}))); return nil; }); (function($base, $super) { function $BaseMutator(){}; var self = $BaseMutator = $klass($base, $super, 'BaseMutator', $BaseMutator); var def = self.$$proto, $scope = self.$$scope; def.full_constant_name = def.context_parts = nil; self.$include($scope.get('RecursiveConstMethods')); self.$attr_reader("original_value", "full_constant_name"); def.$initialize = function(full_constant_name, mutated_value, transfer_nested_constants) { var self = this; self.full_constant_name = self.$normalize_const_name(full_constant_name); self.mutated_value = mutated_value; self.transfer_nested_constants = transfer_nested_constants; self.context_parts = self.full_constant_name.$split("::"); return self.const_name = self.context_parts.$pop(); }; return (def.$to_constant = function() { var $a, $b, self = this, const$ = nil; const$ = $scope.get('Constant').$new(self.$full_constant_name()); (($a = [self.$original_value()]), $b = const$, $b['$original_value='].apply($b, $a), $a[$a.length-1]); return const$; }, nil) && 'to_constant'; })(self, null); (function($base, $super) { function $ConstantHider(){}; var self = $ConstantHider = $klass($base, $super, 'ConstantHider', $ConstantHider); var def = self.$$proto, $scope = self.$$scope, TMP_5; def.context_parts = def.context = def.const_name = def.original_value = nil; def.$mutate = function() { var self = this; self.context = self.$recursive_const_get(self.context_parts.$join("::")); self.original_value = self.$get_const_defined_on(self.context, self.const_name); return self.context.$__send__("remove_const", self.const_name); }; def.$to_constant = TMP_5 = function() {var $zuper = $slice.call(arguments, 0); var $a, $b, self = this, $iter = TMP_5.$$p, $yield = $iter || nil, const$ = nil; TMP_5.$$p = null; const$ = $opal.find_super_dispatcher(self, 'to_constant', TMP_5, $iter).apply(self, $zuper); (($a = [true]), $b = const$, $b['$hidden='].apply($b, $a), $a[$a.length-1]); (($a = [true]), $b = const$, $b['$previously_defined='].apply($b, $a), $a[$a.length-1]); return const$; }; return (def.$rspec_reset = function() { var self = this; return self.context.$const_set(self.const_name, self.original_value); }, nil) && 'rspec_reset'; })(self, $scope.get('BaseMutator')); (function($base, $super) { function $DefinedConstantReplacer(){}; var self = $DefinedConstantReplacer = $klass($base, $super, 'DefinedConstantReplacer', $DefinedConstantReplacer); var def = self.$$proto, $scope = self.$$scope, TMP_6; def.context_parts = def.context = def.const_name = def.mutated_value = def.original_value = def.transfer_nested_constants = def.full_constant_name = nil; def.$mutate = function() { var self = this, constants_to_transfer = nil; self.context = self.$recursive_const_get(self.context_parts.$join("::")); self.original_value = self.$get_const_defined_on(self.context, self.const_name); constants_to_transfer = self['$verify_constants_to_transfer!'](); self.context.$__send__("remove_const", self.const_name); self.context.$const_set(self.const_name, self.mutated_value); return self.$transfer_nested_constants(constants_to_transfer); }; def.$to_constant = TMP_6 = function() {var $zuper = $slice.call(arguments, 0); var $a, $b, self = this, $iter = TMP_6.$$p, $yield = $iter || nil, const$ = nil; TMP_6.$$p = null; const$ = $opal.find_super_dispatcher(self, 'to_constant', TMP_6, $iter).apply(self, $zuper); (($a = [true]), $b = const$, $b['$stubbed='].apply($b, $a), $a[$a.length-1]); (($a = [true]), $b = const$, $b['$previously_defined='].apply($b, $a), $a[$a.length-1]); return const$; }; def.$rspec_reset = function() { var self = this; self.context.$__send__("remove_const", self.const_name); return self.context.$const_set(self.const_name, self.original_value); }; def.$transfer_nested_constants = function(constants) { var $a, $b, TMP_7, self = this; return ($a = ($b = constants).$each, $a.$$p = (TMP_7 = function(const$){var self = TMP_7.$$s || this; if (self.mutated_value == null) self.mutated_value = nil; if (const$ == null) const$ = nil; return self.mutated_value.$const_set(const$, self.$get_const_defined_on(self.$original_value(), const$))}, TMP_7.$$s = self, TMP_7), $a).call($b); }; return (def['$verify_constants_to_transfer!'] = function() { var $a, $b, TMP_8, $c, self = this, undefined_constants = nil, available_constants = nil; if ((($a = self.transfer_nested_constants) !== nil && (!$a.$$is_boolean || $a == true))) { } else { return [] }; ($a = ($b = $hash(self.original_value, "the original value", self.mutated_value, "the stubbed value")).$each, $a.$$p = (TMP_8 = function(value, description){var self = TMP_8.$$s || this, $a; if (self.full_constant_name == null) self.full_constant_name = nil; if (value == null) value = nil;if (description == null) description = nil; if ((($a = value['$respond_to?']("constants")) !== nil && (!$a.$$is_boolean || $a == true))) { return nil } else { return self.$raise($scope.get('ArgumentError'), ((("Cannot transfer nested constants for ") + (self.full_constant_name)) + " ")['$+']("since " + (description) + " is not a class or module and only classes ")['$+']("and modules support nested constants.")) }}, TMP_8.$$s = self, TMP_8), $a).call($b); if ((($a = $scope.get('Array')['$==='](self.transfer_nested_constants)) !== nil && (!$a.$$is_boolean || $a == true))) { if ($scope.get('RUBY_VERSION')['$==']("1.8.7")) { self.transfer_nested_constants = ($a = ($c = self.transfer_nested_constants).$map, $a.$$p = "to_s".$to_proc(), $a).call($c)}; undefined_constants = self.transfer_nested_constants['$-'](self.$constants_defined_on(self.original_value)); if ((($a = undefined_constants['$any?']()) !== nil && (!$a.$$is_boolean || $a == true))) { available_constants = self.$constants_defined_on(self.original_value)['$-'](self.transfer_nested_constants); self.$raise($scope.get('ArgumentError'), ((("Cannot transfer nested constant(s) ") + (undefined_constants.$join(" and "))) + " ")['$+']("for " + (self.full_constant_name) + " since they are not defined. Did you mean ")['$+']("" + (available_constants.$join(" or ")) + "?"));}; return self.transfer_nested_constants; } else { return self.$constants_defined_on(self.original_value) }; }, nil) && 'verify_constants_to_transfer!'; })(self, $scope.get('BaseMutator')); (function($base, $super) { function $UndefinedConstantSetter(){}; var self = $UndefinedConstantSetter = $klass($base, $super, 'UndefinedConstantSetter', $UndefinedConstantSetter); var def = self.$$proto, $scope = self.$$scope, TMP_11; def.context_parts = def.deepest_defined_const = def.const_name = def.mutated_value = def.const_to_remove = nil; def.$mutate = function() { var $a, $b, TMP_9, $c, TMP_10, self = this, remaining_parts = nil, context = nil; remaining_parts = self.context_parts.$dup(); self.deepest_defined_const = ($a = ($b = self.context_parts).$inject, $a.$$p = (TMP_9 = function(klass, name){var self = TMP_9.$$s || this, $a; if (klass == null) klass = nil;if (name == null) name = nil; if ((($a = self['$const_defined_on?'](klass, name)) !== nil && (!$a.$$is_boolean || $a == true))) { } else { return ($breaker.$v = klass, $breaker) }; remaining_parts.$shift(); return self.$get_const_defined_on(klass, name);}, TMP_9.$$s = self, TMP_9), $a).call($b, $scope.get('Object')); context = ($a = ($c = remaining_parts).$inject, $a.$$p = (TMP_10 = function(klass, name){var self = TMP_10.$$s || this; if (klass == null) klass = nil;if (name == null) name = nil; return klass.$const_set(name, $scope.get('Module').$new())}, TMP_10.$$s = self, TMP_10), $a).call($c, self.deepest_defined_const); self.const_to_remove = ((($a = remaining_parts.$first()) !== false && $a !== nil) ? $a : self.const_name); return context.$const_set(self.const_name, self.mutated_value); }; def.$to_constant = TMP_11 = function() {var $zuper = $slice.call(arguments, 0); var $a, $b, self = this, $iter = TMP_11.$$p, $yield = $iter || nil, const$ = nil; TMP_11.$$p = null; const$ = $opal.find_super_dispatcher(self, 'to_constant', TMP_11, $iter).apply(self, $zuper); (($a = [true]), $b = const$, $b['$stubbed='].apply($b, $a), $a[$a.length-1]); (($a = [false]), $b = const$, $b['$previously_defined='].apply($b, $a), $a[$a.length-1]); return const$; }; return (def.$rspec_reset = function() { var self = this; return self.deepest_defined_const.$__send__("remove_const", self.const_to_remove); }, nil) && 'rspec_reset'; })(self, $scope.get('BaseMutator')); $opal.defs(self, '$mutate', function(mutator) { var self = this; self.$register_mutator(mutator); return mutator.$mutate(); }); $opal.defs(self, '$reset_all', function() { var $a, $b, TMP_12, self = this; ($a = ($b = self.$mutators().$reverse()).$each, $a.$$p = (TMP_12 = function(s){var self = TMP_12.$$s || this; if (s == null) s = nil; return s.$rspec_reset()}, TMP_12.$$s = self, TMP_12), $a).call($b); return self.$mutators().$clear(); }); $opal.defs(self, '$mutators', function() { var $a, self = this; if (self.mutators == null) self.mutators = nil; return ((($a = self.mutators) !== false && $a !== nil) ? $a : self.mutators = []); }); $opal.defs(self, '$register_mutator', function(mutator) { var self = this; return self.$mutators()['$<<'](mutator); }); $opal.defs(self, '$find', function(name) { var $a, $b, TMP_13, self = this; return ($a = ($b = self.$mutators()).$find, $a.$$p = (TMP_13 = function(s){var self = TMP_13.$$s || this; if (s == null) s = nil; return s.$full_constant_name()['$=='](name)}, TMP_13.$$s = self, TMP_13), $a).call($b); }); return ($opal.defs(self, '$raise_on_invalid_const', function() { var $a, $b, TMP_14, self = this; return ($a = ($b = self).$lambda, $a.$$p = (TMP_14 = function(const_name, failed_name){var self = TMP_14.$$s || this; if (const_name == null) const_name = nil;if (failed_name == null) failed_name = nil; return self.$raise(((((("Cannot stub constant ") + (failed_name)) + " on ") + (const_name)) + " ")['$+']("since " + (const_name) + " is not a module."))}, TMP_14.$$s = self, TMP_14), $a).call($b); }), nil) && 'raise_on_invalid_const'; })(self, null); $opal.cdecl($scope, 'ConstantStubber', $scope.get('ConstantMutator')); })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/mocks/object_reference"] = 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(['$===', '$new', '$raise', '$inspect', '$name', '$!', '$object', '$private', '$original_value', '$original']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Mocks'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $ObjectReference(){}; var self = $ObjectReference = $klass($base, $super, 'ObjectReference', $ObjectReference); var def = self.$$proto, $scope = self.$$scope; return ($opal.defs(self, '$for', function(object_module_or_name, allow_direct_object_refs) { var self = this, $case = nil; if (allow_direct_object_refs == null) { allow_direct_object_refs = false } return (function() {$case = object_module_or_name;if ($scope.get('Module')['$===']($case)) {return $scope.get('DirectModuleReference').$new(object_module_or_name)}else if ($scope.get('String')['$===']($case)) {return $scope.get('NamedObjectReference').$new(object_module_or_name)}else {if (allow_direct_object_refs !== false && allow_direct_object_refs !== nil) { return $scope.get('DirectObjectReference').$new(object_module_or_name) } else { return self.$raise($scope.get('ArgumentError'), "Module or String expected, got " + (object_module_or_name.$inspect())) }}})(); }), nil) && 'for' })(self, null); (function($base, $super) { function $DirectObjectReference(){}; var self = $DirectObjectReference = $klass($base, $super, 'DirectObjectReference', $DirectObjectReference); var def = self.$$proto, $scope = self.$$scope, TMP_1; def.object = nil; def.$initialize = function(object) { var self = this; return self.object = object; }; def.$description = function() { var self = this; return self.object.$inspect(); }; def.$const_to_replace = function() { var self = this; return self.$raise($scope.get('ArgumentError'), "Can not perform constant replacement with an object."); }; def['$defined?'] = function() { var self = this; return true; }; return (def.$when_loaded = TMP_1 = function() { var $a, self = this, $iter = TMP_1.$$p, $yield = $iter || nil; TMP_1.$$p = null; return $a = $opal.$yield1($yield, self.object), $a === $breaker ? $a : $a; }, nil) && 'when_loaded'; })(self, null); (function($base, $super) { function $DirectModuleReference(){}; var self = $DirectModuleReference = $klass($base, $super, 'DirectModuleReference', $DirectModuleReference); var def = self.$$proto, $scope = self.$$scope; def.object = nil; def.$const_to_replace = function() { var self = this; return self.object.$name(); }; return $opal.defn(self, '$description', def.$const_to_replace); })(self, $scope.get('DirectObjectReference')); (function($base, $super) { function $NamedObjectReference(){}; var self = $NamedObjectReference = $klass($base, $super, 'NamedObjectReference', $NamedObjectReference); var def = self.$$proto, $scope = self.$$scope, TMP_2; def.const_name = def.object = nil; def.$initialize = function(const_name) { var self = this; return self.const_name = const_name; }; def['$defined?'] = function() { var self = this; return self.$object()['$!']()['$!'](); }; def.$const_to_replace = function() { var self = this; return self.const_name; }; $opal.defn(self, '$description', def.$const_to_replace); def.$when_loaded = TMP_2 = function() { var $a, self = this, $iter = TMP_2.$$p, block = $iter || nil; TMP_2.$$p = null; if ((($a = self.$object()) !== nil && (!$a.$$is_boolean || $a == true))) { return $a = $opal.$yield1(block, self.$object()), $a === $breaker ? $a : $a } else { return nil }; }; self.$private(); return (def.$object = function() { var $a, self = this; return ((($a = self.object) !== false && $a !== nil) ? $a : self.object = $scope.get('Constant').$original(self.const_name).$original_value()); }, nil) && 'object'; })(self, null); })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/mocks/order_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, $range = $opal.range; $opal.add_stubs(['$<<', '$==', '$find', '$to_proc', '$remaining_expectations', '$each_with_index', '$ordered?', '$+', '$include?', '$ready_for?', '$consume', '$raise_out_of_order_error', '$expectations_invoked_in_order?', '$clear', '$empty?', '$private', '$[]', '$invoked_expectations', '$expected_invocations', '$select', '$compact', '$map', '$expectation_for']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Mocks'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $OrderGroup(){}; var self = $OrderGroup = $klass($base, $super, 'OrderGroup', $OrderGroup); var def = self.$$proto, $scope = self.$$scope; def.expectations = def.invocation_order = def.index = nil; def.$initialize = function() { var self = this; self.expectations = []; self.invocation_order = []; return self.index = 0; }; def.$register = function(expectation) { var self = this; return self.expectations['$<<'](expectation); }; def.$invoked = function(message) { var self = this; return self.invocation_order['$<<'](message); }; def['$ready_for?'] = function(expectation) { var $a, $b, self = this; return ($a = ($b = self.$remaining_expectations()).$find, $a.$$p = "ordered?".$to_proc(), $a).call($b)['$=='](expectation); }; def.$consume = function() {try { var $a, $b, TMP_1, self = this; ($a = ($b = self.$remaining_expectations()).$each_with_index, $a.$$p = (TMP_1 = function(expectation, index){var self = TMP_1.$$s || this, $a; if (self.index == null) self.index = nil; if (expectation == null) expectation = nil;if (index == null) index = nil; if ((($a = expectation['$ordered?']()) !== nil && (!$a.$$is_boolean || $a == true))) { self.index = self.index['$+'](index['$+'](1)); $opal.$return(expectation); } else { return nil }}, TMP_1.$$s = self, TMP_1), $a).call($b); return nil; } catch ($returner) { if ($returner === $opal.returner) { return $returner.$v } throw $returner; } }; def.$handle_order_constraint = function(expectation) { var $a, $b, self = this; if ((($a = ($b = expectation['$ordered?'](), $b !== false && $b !== nil ?self.$remaining_expectations()['$include?'](expectation) : $b)) !== nil && (!$a.$$is_boolean || $a == true))) { } else { return nil }; if ((($a = self['$ready_for?'](expectation)) !== nil && (!$a.$$is_boolean || $a == true))) { return self.$consume()}; return expectation.$raise_out_of_order_error(); }; def.$verify_invocation_order = function(expectation) { var $a, self = this; if ((($a = self['$expectations_invoked_in_order?']()) !== nil && (!$a.$$is_boolean || $a == true))) { } else { expectation.$raise_out_of_order_error() }; return true; }; def.$clear = function() { var self = this; self.index = 0; self.invocation_order.$clear(); return self.expectations.$clear(); }; def['$empty?'] = function() { var self = this; return self.expectations['$empty?'](); }; self.$private(); def.$remaining_expectations = function() { var $a, self = this; return ((($a = self.expectations['$[]']($range(self.index, -1, false))) !== false && $a !== nil) ? $a : []); }; def['$expectations_invoked_in_order?'] = function() { var self = this; return self.$invoked_expectations()['$=='](self.$expected_invocations()); }; def.$invoked_expectations = function() { var $a, $b, TMP_2, self = this; return ($a = ($b = self.expectations).$select, $a.$$p = (TMP_2 = function(e){var self = TMP_2.$$s || this, $a; if (self.invocation_order == null) self.invocation_order = nil; if (e == null) e = nil; return ($a = e['$ordered?'](), $a !== false && $a !== nil ?self.invocation_order['$include?'](e) : $a)}, TMP_2.$$s = self, TMP_2), $a).call($b); }; def.$expected_invocations = function() { var $a, $b, TMP_3, self = this; return ($a = ($b = self.invocation_order).$map, $a.$$p = (TMP_3 = function(invocation){var self = TMP_3.$$s || this; if (invocation == null) invocation = nil; return self.$expectation_for(invocation)}, TMP_3.$$s = self, TMP_3), $a).call($b).$compact(); }; return (def.$expectation_for = function(message) { var $a, $b, TMP_4, self = this; return ($a = ($b = self.expectations).$find, $a.$$p = (TMP_4 = function(e){var self = TMP_4.$$s || this; if (e == null) e = nil; return message['$=='](e)}, TMP_4.$$s = self, TMP_4), $a).call($b); }, nil) && 'expectation_for'; })(self, null) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/mocks/proxy"] = 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(['$new', '$==', '$orig_object', '$object', '$message', '$expectation_ordering', '$space', '$[]=', '$attr_reader', '$method_double_for', '$null_object?', '$!', '$add_default_stub', '$add_expectation', '$to_proc', '$add_simple_expectation', '$build_expectation', '$any?', '$expectations', '$raise_expectation_on_mocked_method', '$stubs', '$raise_expectation_on_unstubbed_method', '$each', '$matches?', '$invoke', '$call', '$matches_name_but_not_args', '$raise_unexpected_message_args_error', '$add_stub', '$add_simple_stub', '$remove_stub', '$remove_single_stub', '$each_value', '$verify', '$reset', '$clear', '$detect', '$negative_expectation_for?', '$invoked', '$<<', '$record_message_received', '$find_matching_expectation', '$find_matching_method_stub', '$called_max_times?', '$actual_received_count_matters?', '$increase_actual_received_count!', '$find_almost_matching_expectation', '$expected_messages_received?', '$advise', '$has_negative_expectation?', '$find_almost_matching_stub', '$raise_missing_default_stub_error', '$===', '$__send__', '$superclass', '$raise_unexpected_message_error', '$private', '$[]', '$to_sym', '$find_best_matching_expectation_for', '$find', '$any_instance_class_recorder_observing_method?', '$class', '$build_alias_method_name', '$any_instance_recorder_for', '$method_handle_for', '$configure_method', '$already_observing?', '$nil?']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Mocks'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Proxy(){}; var self = $Proxy = $klass($base, $super, 'Proxy', $Proxy); var def = self.$$proto, $scope = self.$$scope, $a, $b, TMP_1, TMP_3, TMP_5, TMP_8, TMP_11, TMP_14, TMP_15, TMP_19; def.null_object = def.object = def.error_generator = def.expectation_ordering = def.messages_received = def.method_doubles = def.order_group = nil; $opal.cdecl($scope, 'SpecificMessage', ($a = ($b = $scope.get('Struct')).$new, $a.$$p = (TMP_1 = function(){var self = TMP_1.$$s || this; return ($opal.defn(self, '$==', function(expectation) { var $a, self = this; return (($a = expectation.$orig_object()['$=='](self.$object())) ? expectation.$message()['$=='](self.$message()) : $a); }), nil) && '=='}, TMP_1.$$s = self, TMP_1), $a).call($b, "object", "message")); def.$initialize = function(object, order_group, name, options) { var $a, $b, TMP_2, self = this; if (name == null) { name = nil } if (options == null) { options = $hash2([], {}) } self.object = object; self.order_group = order_group; self.name = name; self.error_generator = $scope.get('ErrorGenerator').$new(object, name); self.expectation_ordering = (($scope.get('RSpec')).$$scope.get('Mocks')).$space().$expectation_ordering(); self.messages_received = []; self.options = options; self.null_object = false; return self.method_doubles = ($a = ($b = $scope.get('Hash')).$new, $a.$$p = (TMP_2 = function(h, k){var self = TMP_2.$$s || this; if (self.object == null) self.object = nil; if (h == null) h = nil;if (k == null) k = nil; return h['$[]='](k, $scope.get('MethodDouble').$new(self.object, k, self))}, TMP_2.$$s = self, TMP_2), $a).call($b); }; self.$attr_reader("object"); def['$null_object?'] = function() { var self = this; return self.null_object; }; def.$as_null_object = function() { var self = this; self.null_object = true; return self.object; }; def.$method_handle_for = function(message) { var self = this; return nil; }; def.$add_message_expectation = TMP_3 = function(location, method_name, opts) { var $a, $b, TMP_4, $c, self = this, $iter = TMP_3.$$p, block = $iter || nil, meth_double = nil; if (opts == null) { opts = $hash2([], {}) } TMP_3.$$p = null; meth_double = self.$method_double_for(method_name); if ((($a = ($b = self['$null_object?'](), $b !== false && $b !== nil ?block['$!']() : $b)) !== nil && (!$a.$$is_boolean || $a == true))) { ($a = ($b = meth_double).$add_default_stub, $a.$$p = (TMP_4 = function(){var self = TMP_4.$$s || this; if (self.object == null) self.object = nil; return self.object}, TMP_4.$$s = self, TMP_4), $a).call($b, self.error_generator, self.expectation_ordering, location, opts)}; return ($a = ($c = meth_double).$add_expectation, $a.$$p = block.$to_proc(), $a).call($c, self.error_generator, self.expectation_ordering, location, opts); }; def.$add_simple_expectation = function(method_name, response, location) { var self = this; return self.$method_double_for(method_name).$add_simple_expectation(method_name, response, self.error_generator, location); }; def.$build_expectation = function(method_name) { var self = this, meth_double = nil; meth_double = self.$method_double_for(method_name); return meth_double.$build_expectation(self.error_generator, self.expectation_ordering); }; def.$replay_received_message_on = TMP_5 = function(expectation) { var $a, $b, TMP_6, self = this, $iter = TMP_5.$$p, block = $iter || nil, expected_method_name = nil, meth_double = nil; TMP_5.$$p = null; expected_method_name = expectation.$message(); meth_double = self.$method_double_for(expected_method_name); if ((($a = meth_double.$expectations()['$any?']()) !== nil && (!$a.$$is_boolean || $a == true))) { self.error_generator.$raise_expectation_on_mocked_method(expected_method_name)}; if ((($a = ((($b = self['$null_object?']()) !== false && $b !== nil) ? $b : meth_double.$stubs()['$any?']())) !== nil && (!$a.$$is_boolean || $a == true))) { } else { self.error_generator.$raise_expectation_on_unstubbed_method(expected_method_name) }; return ($a = ($b = self.messages_received).$each, $a.$$p = (TMP_6 = function(actual_method_name, args, _){var self = TMP_6.$$s || this, $a, $b; if (actual_method_name == null) actual_method_name = nil;if (args == null) args = nil;if (_ == null) _ = nil; if ((($a = ($b = expectation)['$matches?'].apply($b, [actual_method_name].concat(args))) !== nil && (!$a.$$is_boolean || $a == true))) { expectation.$invoke(nil); if (block !== false && block !== nil) { return ($a = block).$call.apply($a, [].concat(args)) } else { return nil }; } else { return nil }}, TMP_6.$$s = self, TMP_6), $a).call($b); }; def.$check_for_unexpected_arguments = function(expectation) { var $a, $b, TMP_7, self = this; return ($a = ($b = self.messages_received).$each, $a.$$p = (TMP_7 = function(method_name, args, _){var self = TMP_7.$$s || this, $a, $b; if (method_name == null) method_name = nil;if (args == null) args = nil;if (_ == null) _ = nil; if ((($a = ($b = expectation).$matches_name_but_not_args.apply($b, [method_name].concat(args))) !== nil && (!$a.$$is_boolean || $a == true))) { return ($a = self).$raise_unexpected_message_args_error.apply($a, [expectation].concat(args)) } else { return nil }}, TMP_7.$$s = self, TMP_7), $a).call($b); }; def.$add_stub = TMP_8 = function(location, method_name, opts) { var $a, $b, self = this, $iter = TMP_8.$$p, implementation = $iter || nil; if (opts == null) { opts = $hash2([], {}) } TMP_8.$$p = null; return ($a = ($b = self.$method_double_for(method_name)).$add_stub, $a.$$p = implementation.$to_proc(), $a).call($b, self.error_generator, self.expectation_ordering, location, opts); }; def.$add_simple_stub = function(method_name, response) { var self = this; return self.$method_double_for(method_name).$add_simple_stub(method_name, response); }; def.$remove_stub = function(method_name) { var self = this; return self.$method_double_for(method_name).$remove_stub(); }; def.$remove_single_stub = function(method_name, stub) { var self = this; return self.$method_double_for(method_name).$remove_single_stub(stub); }; def.$verify = function() { var $a, $b, TMP_9, self = this; try { return ($a = ($b = self.method_doubles).$each_value, $a.$$p = (TMP_9 = function(d){var self = TMP_9.$$s || this; if (d == null) d = nil; return d.$verify()}, TMP_9.$$s = self, TMP_9), $a).call($b) } finally { self.$reset() }; }; def.$reset = function() { var $a, $b, TMP_10, self = this; ($a = ($b = self.method_doubles).$each_value, $a.$$p = (TMP_10 = function(d){var self = TMP_10.$$s || this; if (d == null) d = nil; return d.$reset()}, TMP_10.$$s = self, TMP_10), $a).call($b); return self.messages_received.$clear(); }; def['$received_message?'] = TMP_11 = function(method_name, args) { var $a, $b, TMP_12, self = this, $iter = TMP_11.$$p, block = $iter || nil; args = $slice.call(arguments, 1); TMP_11.$$p = null; return ($a = ($b = self.messages_received)['$any?'], $a.$$p = (TMP_12 = function(array){var self = TMP_12.$$s || this; if (array == null) array = nil; return array['$==']([method_name, args, block])}, TMP_12.$$s = self, TMP_12), $a).call($b); }; def['$has_negative_expectation?'] = function(message) { var $a, $b, TMP_13, self = this; return ($a = ($b = self.$method_double_for(message).$expectations()).$detect, $a.$$p = (TMP_13 = function(expectation){var self = TMP_13.$$s || this; if (expectation == null) expectation = nil; return expectation['$negative_expectation_for?'](message)}, TMP_13.$$s = self, TMP_13), $a).call($b); }; def.$record_message_received = TMP_14 = function(message, args) { var self = this, $iter = TMP_14.$$p, block = $iter || nil; args = $slice.call(arguments, 1); TMP_14.$$p = null; self.order_group.$invoked($scope.get('SpecificMessage').$new(self.$object(), message)); return self.messages_received['$<<']([message, args, block]); }; def.$message_received = TMP_15 = function(message, args) { var $a, $b, $c, $d, $e, $f, $g, $h, $i, $j, $k, $l, $m, $n, $o, $p, self = this, $iter = TMP_15.$$p, block = $iter || nil, expectation = nil, stub = nil; args = $slice.call(arguments, 1); TMP_15.$$p = null; ($a = ($b = self).$record_message_received, $a.$$p = block.$to_proc(), $a).apply($b, [message].concat(args)); expectation = ($a = self).$find_matching_expectation.apply($a, [message].concat(args)); stub = ($c = self).$find_matching_method_stub.apply($c, [message].concat(args)); if ((($d = ((($e = (($f = (($g = stub !== false && stub !== nil) ? expectation : $g), $f !== false && $f !== nil ?expectation['$called_max_times?']() : $f))) !== false && $e !== nil) ? $e : ((($f = stub !== false && stub !== nil) ? expectation['$!']() : $f)))) !== nil && (!$d.$$is_boolean || $d == true))) { if ((($d = (($e = expectation !== false && expectation !== nil) ? expectation['$actual_received_count_matters?']() : $e)) !== nil && (!$d.$$is_boolean || $d == true))) { expectation['$increase_actual_received_count!']()}; if ((($d = expectation = ($e = self).$find_almost_matching_expectation.apply($e, [message].concat(args))) !== nil && (!$d.$$is_boolean || $d == true))) { if ((($d = expectation['$expected_messages_received?']()) !== nil && (!$d.$$is_boolean || $d == true))) { } else { ($d = expectation).$advise.apply($d, [].concat(args)) }}; return ($f = ($g = stub).$invoke, $f.$$p = block.$to_proc(), $f).apply($g, [nil].concat(args)); } else if (expectation !== false && expectation !== nil) { return ($f = ($h = expectation).$invoke, $f.$$p = block.$to_proc(), $f).apply($h, [stub].concat(args)) } else if ((($f = expectation = ($i = self).$find_almost_matching_expectation.apply($i, [message].concat(args))) !== nil && (!$f.$$is_boolean || $f == true))) { if ((($f = expectation['$expected_messages_received?']()) !== nil && (!$f.$$is_boolean || $f == true))) { } else if ((($f = self['$null_object?']()) !== nil && (!$f.$$is_boolean || $f == true))) { ($f = expectation).$advise.apply($f, [].concat(args))}; if ((($j = (((($k = self['$has_negative_expectation?'](message)) !== false && $k !== nil) ? $k : self['$null_object?']()))) !== nil && (!$j.$$is_boolean || $j == true))) { return nil } else { return ($j = self).$raise_unexpected_message_args_error.apply($j, [expectation].concat(args)) }; } else if ((($k = stub = ($l = self).$find_almost_matching_stub.apply($l, [message].concat(args))) !== nil && (!$k.$$is_boolean || $k == true))) { ($k = stub).$advise.apply($k, [].concat(args)); return ($m = self).$raise_missing_default_stub_error.apply($m, [stub].concat(args)); } else if ((($n = $scope.get('Class')['$==='](self.object)) !== nil && (!$n.$$is_boolean || $n == true))) { return ($n = ($o = self.object.$superclass()).$__send__, $n.$$p = block.$to_proc(), $n).apply($o, [message].concat(args)) } else { return ($n = ($p = self.object).$__send__, $n.$$p = block.$to_proc(), $n).apply($p, ["method_missing", message].concat(args)) }; }; def.$raise_unexpected_message_error = function(method_name, args) { var $a, self = this; args = $slice.call(arguments, 1); return ($a = self.error_generator).$raise_unexpected_message_error.apply($a, [method_name].concat(args)); }; def.$raise_unexpected_message_args_error = function(expectation, args) { var $a, self = this; args = $slice.call(arguments, 1); return ($a = self.error_generator).$raise_unexpected_message_args_error.apply($a, [expectation].concat(args)); }; def.$raise_missing_default_stub_error = function(expectation, args) { var $a, self = this; args = $slice.call(arguments, 1); return ($a = self.error_generator).$raise_missing_default_stub_error.apply($a, [expectation].concat(args)); }; self.$private(); def.$method_double_for = function(message) { var self = this; return self.method_doubles['$[]'](message.$to_sym()); }; def.$find_matching_expectation = function(method_name, args) { var $a, $b, TMP_16, self = this; args = $slice.call(arguments, 1); return ($a = ($b = self).$find_best_matching_expectation_for, $a.$$p = (TMP_16 = function(expectation){var self = TMP_16.$$s || this, $a; if (expectation == null) expectation = nil; return ($a = expectation)['$matches?'].apply($a, [method_name].concat(args))}, TMP_16.$$s = self, TMP_16), $a).call($b, method_name); }; def.$find_almost_matching_expectation = function(method_name, args) { var $a, $b, TMP_17, self = this; args = $slice.call(arguments, 1); return ($a = ($b = self).$find_best_matching_expectation_for, $a.$$p = (TMP_17 = function(expectation){var self = TMP_17.$$s || this, $a; if (expectation == null) expectation = nil; return ($a = expectation).$matches_name_but_not_args.apply($a, [method_name].concat(args))}, TMP_17.$$s = self, TMP_17), $a).call($b, method_name); }; def.$find_best_matching_expectation_for = TMP_19 = function(method_name) {try { var $a, $b, TMP_18, self = this, $iter = TMP_19.$$p, $yield = $iter || nil, first_match = nil; TMP_19.$$p = null; first_match = nil; ($a = ($b = self.$method_double_for(method_name).$expectations()).$each, $a.$$p = (TMP_18 = function(expectation){var self = TMP_18.$$s || this, $a, $b; if (expectation == null) expectation = nil; if ((($a = ((($b = $opal.$yield1($yield, expectation)) === $breaker) ? $breaker.$v : $b)) !== nil && (!$a.$$is_boolean || $a == true))) { } else { return nil; }; if ((($a = expectation['$called_max_times?']()) !== nil && (!$a.$$is_boolean || $a == true))) { } else { $opal.$return(expectation) }; return ((($a = first_match) !== false && $a !== nil) ? $a : first_match = expectation);}, TMP_18.$$s = self, TMP_18), $a).call($b); return first_match; } catch ($returner) { if ($returner === $opal.returner) { return $returner.$v } throw $returner; } }; def.$find_matching_method_stub = function(method_name, args) { var $a, $b, TMP_20, self = this; args = $slice.call(arguments, 1); return ($a = ($b = self.$method_double_for(method_name).$stubs()).$find, $a.$$p = (TMP_20 = function(stub){var self = TMP_20.$$s || this, $a; if (stub == null) stub = nil; return ($a = stub)['$matches?'].apply($a, [method_name].concat(args))}, TMP_20.$$s = self, TMP_20), $a).call($b); }; return (def.$find_almost_matching_stub = function(method_name, args) { var $a, $b, TMP_21, self = this; args = $slice.call(arguments, 1); return ($a = ($b = self.$method_double_for(method_name).$stubs()).$find, $a.$$p = (TMP_21 = function(stub){var self = TMP_21.$$s || this, $a; if (stub == null) stub = nil; return ($a = stub).$matches_name_but_not_args.apply($a, [method_name].concat(args))}, TMP_21.$$s = self, TMP_21), $a).call($b); }, nil) && 'find_almost_matching_stub'; })(self, null); (function($base, $super) { function $PartialMockProxy(){}; var self = $PartialMockProxy = $klass($base, $super, 'PartialMockProxy', $PartialMockProxy); var def = self.$$proto, $scope = self.$$scope, TMP_22, TMP_23; def.object = nil; def.$method_handle_for = function(message) { var $a, self = this; try { if ((($a = self['$any_instance_class_recorder_observing_method?'](self.object.$class(), message)) !== nil && (!$a.$$is_boolean || $a == true))) { message = ((Opal.get('RSpec')).$$scope.get('Mocks')).$any_instance_recorder_for(self.object.$class()).$build_alias_method_name(message)}; return ((Opal.get('RSpec')).$$scope.get('Mocks')).$method_handle_for(self.object, message); } catch ($err) {if ($opal.$rescue($err, [$scope.get('NameError')])) { return nil }else { throw $err; } }; }; def.$add_simple_expectation = TMP_22 = function(method_name, response, location) {var $zuper = $slice.call(arguments, 0); var self = this, $iter = TMP_22.$$p, $yield = $iter || nil; TMP_22.$$p = null; self.$method_double_for(method_name).$configure_method(); return $opal.find_super_dispatcher(self, 'add_simple_expectation', TMP_22, $iter).apply(self, $zuper); }; def.$add_simple_stub = TMP_23 = function(method_name, response) {var $zuper = $slice.call(arguments, 0); var self = this, $iter = TMP_23.$$p, $yield = $iter || nil; TMP_23.$$p = null; self.$method_double_for(method_name).$configure_method(); return $opal.find_super_dispatcher(self, 'add_simple_stub', TMP_23, $iter).apply(self, $zuper); }; self.$private(); return (def['$any_instance_class_recorder_observing_method?'] = function(klass, method_name) { var $a, self = this, superklass = nil; if ((($a = ((Opal.get('RSpec')).$$scope.get('Mocks')).$any_instance_recorder_for(klass)['$already_observing?'](method_name)) !== nil && (!$a.$$is_boolean || $a == true))) { return true}; superklass = klass.$superclass(); if ((($a = superklass['$nil?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return false}; return self['$any_instance_class_recorder_observing_method?'](superklass, method_name); }, nil) && 'any_instance_class_recorder_observing_method?'; })(self, $scope.get('Proxy')); })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/mocks/proxy_for_nil"] = 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(['$attr_accessor', '$warn_about_expectations?', '$warn', '$private', '$first_non_rspec_line']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Mocks'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $ProxyForNil(){}; var self = $ProxyForNil = $klass($base, $super, 'ProxyForNil', $ProxyForNil); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4; def.$initialize = TMP_1 = function(order_group) { var self = this, $iter = TMP_1.$$p, $yield = $iter || nil; TMP_1.$$p = null; self.warn_about_expectations = true; return $opal.find_super_dispatcher(self, 'initialize', TMP_1, null).apply(self, [nil, order_group]); }; self.$attr_accessor("warn_about_expectations"); $opal.defn(self, '$warn_about_expectations?', def.$warn_about_expectations); def.$add_message_expectation = TMP_2 = function(location, method_name, opts) {var $zuper = $slice.call(arguments, 0); var $a, self = this, $iter = TMP_2.$$p, block = $iter || nil; if (opts == null) { opts = $hash2([], {}) } TMP_2.$$p = null; if ((($a = self['$warn_about_expectations?']()) !== nil && (!$a.$$is_boolean || $a == true))) { self.$warn(method_name)}; return $opal.find_super_dispatcher(self, 'add_message_expectation', TMP_2, $iter).apply(self, $zuper); }; def.$add_negative_message_expectation = TMP_3 = function(location, method_name) {var $zuper = $slice.call(arguments, 0); var $a, self = this, $iter = TMP_3.$$p, implementation = $iter || nil; TMP_3.$$p = null; if ((($a = self['$warn_about_expectations?']()) !== nil && (!$a.$$is_boolean || $a == true))) { self.$warn(method_name)}; return $opal.find_super_dispatcher(self, 'add_negative_message_expectation', TMP_3, $iter).apply(self, $zuper); }; def.$add_stub = TMP_4 = function(location, method_name, opts) {var $zuper = $slice.call(arguments, 0); var $a, self = this, $iter = TMP_4.$$p, implementation = $iter || nil; if (opts == null) { opts = $hash2([], {}) } TMP_4.$$p = null; if ((($a = self['$warn_about_expectations?']()) !== nil && (!$a.$$is_boolean || $a == true))) { self.$warn(method_name)}; return $opal.find_super_dispatcher(self, 'add_stub', TMP_4, $iter).apply(self, $zuper); }; self.$private(); return (def.$warn = function(method_name) { var self = this, source = nil; source = $scope.get('CallerFilter').$first_non_rspec_line(); return $scope.get('Kernel').$warn("An expectation of :" + (method_name) + " was set on nil. Called from " + (source) + ". Use allow_message_expectations_on_nil to disable warnings."); }, nil) && 'warn'; })(self, $scope.get('Proxy')) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/mocks/space"] = 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(['$attr_reader', '$each_value', '$verify', '$proxies', '$any_instance_recorders', '$reset_all', '$reset', '$clear', '$expectation_ordering', '$new', '$__id__', '$fetch', '$[]=', '$delete', '$select', '$===', '$object', '$values', '$id_for', '$__build_mock_proxy', '$verify_partial_doubles?', '$configuration', '$has_key?', '$!', '$method_defined?', '$require', '$equal?', '$_id2ref', '$instance_exec', '$uuid']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Mocks'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Space(){}; var self = $Space = $klass($base, $super, 'Space', $Space); var def = self.$$proto, $scope = self.$$scope, $a, $b; def.expectation_ordering = nil; self.$attr_reader("proxies", "any_instance_recorders"); def.$initialize = function() { var self = this; self.proxies = $hash2([], {}); return self.any_instance_recorders = $hash2([], {}); }; def.$verify_all = function() { var $a, $b, TMP_1, $c, TMP_2, self = this; ($a = ($b = self.$proxies()).$each_value, $a.$$p = (TMP_1 = function(object){var self = TMP_1.$$s || this; if (object == null) object = nil; return object.$verify()}, TMP_1.$$s = self, TMP_1), $a).call($b); return ($a = ($c = self.$any_instance_recorders()).$each_value, $a.$$p = (TMP_2 = function(recorder){var self = TMP_2.$$s || this; if (recorder == null) recorder = nil; return recorder.$verify()}, TMP_2.$$s = self, TMP_2), $a).call($c); }; def.$reset_all = function() { var $a, $b, TMP_3, self = this; $scope.get('ConstantMutator').$reset_all(); ($a = ($b = self.$proxies()).$each_value, $a.$$p = (TMP_3 = function(object){var self = TMP_3.$$s || this; if (object == null) object = nil; return object.$reset()}, TMP_3.$$s = self, TMP_3), $a).call($b); self.$proxies().$clear(); self.$any_instance_recorders().$clear(); return self.$expectation_ordering().$clear(); }; def.$expectation_ordering = function() { var $a, self = this; return ((($a = self.expectation_ordering) !== false && $a !== nil) ? $a : self.expectation_ordering = $scope.get('OrderGroup').$new()); }; def.$any_instance_recorder_for = function(klass) { var $a, $b, TMP_4, self = this, id = nil; id = klass.$__id__(); return ($a = ($b = self.$any_instance_recorders()).$fetch, $a.$$p = (TMP_4 = function(){var self = TMP_4.$$s || this; return self.$any_instance_recorders()['$[]='](id, (($scope.get('AnyInstance')).$$scope.get('Recorder')).$new(klass))}, TMP_4.$$s = self, TMP_4), $a).call($b, id); }; def.$remove_any_instance_recorder_for = function(klass) { var self = this; return self.$any_instance_recorders().$delete(klass.$__id__()); }; def.$proxies_of = function(klass) { var $a, $b, TMP_5, self = this; return ($a = ($b = self.$proxies().$values()).$select, $a.$$p = (TMP_5 = function(proxy){var self = TMP_5.$$s || this; if (proxy == null) proxy = nil; return klass['$==='](proxy.$object())}, TMP_5.$$s = self, TMP_5), $a).call($b); }; def.$proxy_for = function(object) { var $a, $b, TMP_6, self = this, id = nil; id = self.$id_for(object); return ($a = ($b = self.$proxies()).$fetch, $a.$$p = (TMP_6 = function(){var self = TMP_6.$$s || this, $a, $case = nil; return self.$proxies()['$[]='](id, (function() {$case = object;if ($scope.get('NilClass')['$===']($case)) {return $scope.get('ProxyForNil').$new(self.$expectation_ordering())}else if ($scope.get('TestDouble')['$===']($case)) {return object.$__build_mock_proxy(self.$expectation_ordering())}else {if ((($a = (($scope.get('RSpec')).$$scope.get('Mocks')).$configuration()['$verify_partial_doubles?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return $scope.get('VerifyingPartialMockProxy').$new(object, self.$expectation_ordering()) } else { return $scope.get('PartialMockProxy').$new(object, self.$expectation_ordering()) }}})())}, TMP_6.$$s = self, TMP_6), $a).call($b, id); }; $opal.defn(self, '$ensure_registered', def.$proxy_for); def['$registered?'] = function(object) { var self = this; return self.$proxies()['$has_key?'](self.$id_for(object)); }; if ((($a = ($b = ($opal.Object.$$scope.BasicObject == null ? nil : 'constant'), $b !== false && $b !== nil ?Opal.get('BasicObject')['$method_defined?']("__id__")['$!']() : $b)) !== nil && (!$a.$$is_boolean || $a == true))) { self.$require("securerandom"); return (def.$id_for = function(object) { var $a, $b, TMP_7, self = this, id = nil; id = object.$__id__(); if ((($a = object['$equal?'](Opal.get('ObjectSpace').$_id2ref(id))) !== nil && (!$a.$$is_boolean || $a == true))) { return id}; return ($a = ($b = object).$instance_exec, $a.$$p = (TMP_7 = function(){var self = TMP_7.$$s || this, $a; if (self.__id_for_rspec_mocks_space == null) self.__id_for_rspec_mocks_space = nil; return ((($a = self.__id_for_rspec_mocks_space) !== false && $a !== nil) ? $a : self.__id_for_rspec_mocks_space = Opal.get('SecureRandom').$uuid())}, TMP_7.$$s = self, TMP_7), $a).call($b); }, nil) && 'id_for'; } else { return (def.$id_for = function(object) { var self = this; return object.$__id__(); }, nil) && 'id_for' }; })(self, null) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/mocks/standalone"] = 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', '$setup']); self.$require("rspec/mocks"); return (($scope.get('RSpec')).$$scope.get('Mocks')).$setup(self); }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/mocks/stub_chain"] = 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(['$stub_chain', '$new', '$to_proc', '$attr_reader', '$format_chain', '$>', '$length', '$chain', '$find_matching_stub', '$shift', '$block', '$invoke', '$stub', '$object', '$stub_chain_on', '$private', '$===', '$last', '$pop', '$each', '$<<', '$lambda', '$split', '$join', '$__send__', '$proxy_for', '$to_sym', '$first']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Mocks'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $StubChain(){}; var self = $StubChain = $klass($base, $super, 'StubChain', $StubChain); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_4; $opal.defs(self, '$stub_chain_on', TMP_1 = function(object, chain) { var $a, $b, self = this, $iter = TMP_1.$$p, blk = $iter || nil; chain = $slice.call(arguments, 1); TMP_1.$$p = null; return ($a = ($b = self).$new, $a.$$p = blk.$to_proc(), $a).apply($b, [object].concat(chain)).$stub_chain(); }); self.$attr_reader("object", "chain", "block"); def.$initialize = TMP_2 = function(object, chain) { var $a, $b, $c, self = this, $iter = TMP_2.$$p, blk = $iter || nil; chain = $slice.call(arguments, 1); TMP_2.$$p = null; self.object = object; return $a = $opal.to_ary(($b = ($c = self).$format_chain, $b.$$p = blk.$to_proc(), $b).apply($c, [].concat(chain))), self.chain = ($a[0] == null ? nil : $a[0]), self.block = ($a[1] == null ? nil : $a[1]); }; def.$stub_chain = function() { var $a, $b, $c, TMP_3, $d, $e, self = this, matching_stub = nil, next_in_chain = nil; if (self.$chain().$length()['$>'](1)) { if ((($a = matching_stub = self.$find_matching_stub()) !== nil && (!$a.$$is_boolean || $a == true))) { self.$chain().$shift(); return ($a = ($b = matching_stub.$invoke(nil)).$stub_chain, $a.$$p = self.$block().$to_proc(), $a).apply($b, [].concat(self.$chain())); } else { next_in_chain = $scope.get('Mock').$new(); ($a = ($c = self.$object()).$stub, $a.$$p = (TMP_3 = function(){var self = TMP_3.$$s || this; return next_in_chain}, TMP_3.$$s = self, TMP_3), $a).call($c, self.$chain().$shift()); return ($a = ($d = $scope.get('StubChain')).$stub_chain_on, $a.$$p = self.$block().$to_proc(), $a).apply($d, [next_in_chain].concat(self.$chain())); } } else { return ($a = ($e = self.$object()).$stub, $a.$$p = self.$block().$to_proc(), $a).call($e, self.$chain().$shift()) }; }; self.$private(); def.$format_chain = TMP_4 = function(chain) { var $a, $b, TMP_5, self = this, $iter = TMP_4.$$p, blk = $iter || nil, hash = nil; chain = $slice.call(arguments, 0); TMP_4.$$p = null; if ((($a = $scope.get('Hash')['$==='](chain.$last())) !== nil && (!$a.$$is_boolean || $a == true))) { hash = chain.$pop(); ($a = ($b = hash).$each, $a.$$p = (TMP_5 = function(k, v){var self = TMP_5.$$s || this, $a, $b, TMP_6; if (k == null) k = nil;if (v == null) v = nil; chain['$<<'](k); return blk = ($a = ($b = self).$lambda, $a.$$p = (TMP_6 = function(){var self = TMP_6.$$s || this; return v}, TMP_6.$$s = self, TMP_6), $a).call($b);}, TMP_5.$$s = self, TMP_5), $a).call($b);}; return [chain.$join(".").$split("."), blk]; }; return (def.$find_matching_stub = function() { var self = this; return ((Opal.get('RSpec')).$$scope.get('Mocks')).$proxy_for(self.$object()).$__send__("find_matching_method_stub", self.$chain().$first().$to_sym()); }, nil) && 'find_matching_stub'; })(self, null) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/mocks/syntax"] = 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, $hash2 = $opal.hash2; $opal.add_stubs(['$deprecate', '$should_enabled?', '$class_exec', '$warn_unless_should_configured', '$[]', '$[]=', '$first_non_rspec_line', '$expect_message', '$to_proc', '$never', '$===', '$each', '$and_return', '$stub', '$allow_message', '$remove_stub', '$proxy_for', '$space', '$stub_chain_on', '$as_null_object', '$received_message?', '$respond_to?', '$any_instance_recorder_for', '$default_should_syntax_host', '$expect_enabled?', '$new', '$warn_about_block', '$method_defined?', '$==', '$>', '$to_f', '$last', '$ancestors']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Mocks'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Syntax'); var def = self.$$proto, $scope = self.$$scope; $opal.defs(self, '$warn_about_should!', function() { var self = this; return self.warn_about_should = true; }); $opal.defs(self, '$warn_unless_should_configured', function(method_name) { var $a, self = this; if (self.warn_about_should == null) self.warn_about_should = nil; if ((($a = self.warn_about_should) !== nil && (!$a.$$is_boolean || $a == true))) { $scope.get('RSpec').$deprecate("Using `" + (method_name) + "` from rspec-mocks' old `:should` syntax without explicitly enabling the syntax", $hash2(["replacement"], {"replacement": "the new `:expect` syntax or explicitly enable `:should`"})); return self.warn_about_should = false; } else { return nil }; }); $opal.defs(self, '$enable_should', function(syntax_host) { var $a, $b, TMP_1, self = this; if (syntax_host == null) { syntax_host = self.$default_should_syntax_host() } self.warn_about_should = false; if ((($a = self['$should_enabled?'](syntax_host)) !== nil && (!$a.$$is_boolean || $a == true))) { return nil}; return ($a = ($b = syntax_host).$class_exec, $a.$$p = (TMP_1 = function(){var self = TMP_1.$$s || this, TMP_2, TMP_3, TMP_4, TMP_6, TMP_7, $a, $b, TMP_8; $opal.defn(self, '$should_receive', TMP_2 = function(message, opts) { var $a, $b, $c, self = this, $iter = TMP_2.$$p, block = $iter || nil; if (opts == null) { opts = $hash2([], {}) } TMP_2.$$p = null; ((((Opal.get('RSpec')).$$scope.get('Mocks'))).$$scope.get('Syntax')).$warn_unless_should_configured("should_receive"); ($a = "expected_from", $b = opts, ((($c = $b['$[]']($a)) !== false && $c !== nil) ? $c : $b['$[]=']($a, $scope.get('CallerFilter').$first_non_rspec_line()))); return ($a = ($b = ((Opal.get('RSpec')).$$scope.get('Mocks'))).$expect_message, $a.$$p = block.$to_proc(), $a).call($b, self, message, opts); }); $opal.defn(self, '$should_not_receive', TMP_3 = function(message) { var $a, $b, self = this, $iter = TMP_3.$$p, block = $iter || nil, opts = nil; TMP_3.$$p = null; ((((Opal.get('RSpec')).$$scope.get('Mocks'))).$$scope.get('Syntax')).$warn_unless_should_configured("should_not_receive"); opts = $hash2(["expected_from"], {"expected_from": $scope.get('CallerFilter').$first_non_rspec_line()}); return ($a = ($b = ((Opal.get('RSpec')).$$scope.get('Mocks'))).$expect_message, $a.$$p = block.$to_proc(), $a).call($b, self, message, opts).$never(); }); $opal.defn(self, '$stub', TMP_4 = function(message_or_hash, opts) { var $a, $b, TMP_5, $c, self = this, $iter = TMP_4.$$p, block = $iter || nil; if (opts == null) { opts = $hash2([], {}) } TMP_4.$$p = null; ((((Opal.get('RSpec')).$$scope.get('Mocks'))).$$scope.get('Syntax')).$warn_unless_should_configured("stub"); if ((($a = Opal.get('Hash')['$==='](message_or_hash)) !== nil && (!$a.$$is_boolean || $a == true))) { return ($a = ($b = message_or_hash).$each, $a.$$p = (TMP_5 = function(message, value){var self = TMP_5.$$s || this; if (message == null) message = nil;if (value == null) value = nil; return self.$stub(message).$and_return(value)}, TMP_5.$$s = self, TMP_5), $a).call($b) } else { opts['$[]=']("expected_from", $scope.get('CallerFilter').$first_non_rspec_line()); return ($a = ($c = ((Opal.get('RSpec')).$$scope.get('Mocks'))).$allow_message, $a.$$p = block.$to_proc(), $a).call($c, self, message_or_hash, opts); }; }); $opal.defn(self, '$unstub', function(message) { var self = this; ((((Opal.get('RSpec')).$$scope.get('Mocks'))).$$scope.get('Syntax')).$warn_unless_should_configured("unstub"); return ((Opal.get('RSpec')).$$scope.get('Mocks')).$space().$proxy_for(self).$remove_stub(message); }); $opal.defn(self, '$stub_chain', TMP_6 = function(chain) { var $a, $b, self = this, $iter = TMP_6.$$p, blk = $iter || nil; chain = $slice.call(arguments, 0); TMP_6.$$p = null; ((((Opal.get('RSpec')).$$scope.get('Mocks'))).$$scope.get('Syntax')).$warn_unless_should_configured("stub_chain"); return ($a = ($b = ((((Opal.get('RSpec')).$$scope.get('Mocks'))).$$scope.get('StubChain'))).$stub_chain_on, $a.$$p = blk.$to_proc(), $a).apply($b, [self].concat(chain)); }); $opal.defn(self, '$as_null_object', function() { var self = this; ((((Opal.get('RSpec')).$$scope.get('Mocks'))).$$scope.get('Syntax')).$warn_unless_should_configured("as_null_object"); self._null_object = true; return ((Opal.get('RSpec')).$$scope.get('Mocks')).$proxy_for(self).$as_null_object(); }); $opal.defn(self, '$null_object?', function() { var $a, self = this; ((((Opal.get('RSpec')).$$scope.get('Mocks'))).$$scope.get('Syntax')).$warn_unless_should_configured("null_object?"); return (($a = self['_null_object'], $a != null && $a !== nil) ? 'instance-variable' : nil); }); $opal.defn(self, '$received_message?', TMP_7 = function(message, args) { var $a, $b, self = this, $iter = TMP_7.$$p, block = $iter || nil; args = $slice.call(arguments, 1); TMP_7.$$p = null; ((((Opal.get('RSpec')).$$scope.get('Mocks'))).$$scope.get('Syntax')).$warn_unless_should_configured("received_message?"); return ($a = ($b = ((Opal.get('RSpec')).$$scope.get('Mocks')).$proxy_for(self))['$received_message?'], $a.$$p = block.$to_proc(), $a).apply($b, [message].concat(args)); }); if ((($a = $scope.get('Class')['$respond_to?']("any_instance")) !== nil && (!$a.$$is_boolean || $a == true))) { return nil } else { return ($a = ($b = $scope.get('Class')).$class_exec, $a.$$p = (TMP_8 = function(){var self = TMP_8.$$s || this; return ($opal.defn(self, '$any_instance', function() { var self = this; ((((Opal.get('RSpec')).$$scope.get('Mocks'))).$$scope.get('Syntax')).$warn_unless_should_configured("any_instance"); return ((Opal.get('RSpec')).$$scope.get('Mocks')).$any_instance_recorder_for(self); }), nil) && 'any_instance'}, TMP_8.$$s = self, TMP_8), $a).call($b) };}, TMP_1.$$s = self, TMP_1), $a).call($b); }); $opal.defs(self, '$disable_should', function(syntax_host) { var $a, $b, TMP_9, $c, TMP_10, self = this; if (syntax_host == null) { syntax_host = self.$default_should_syntax_host() } if ((($a = self['$should_enabled?'](syntax_host)) !== nil && (!$a.$$is_boolean || $a == true))) { } else { return nil }; ($a = ($b = syntax_host).$class_exec, $a.$$p = (TMP_9 = function(){var self = TMP_9.$$s || this; delete def.$should_receive; delete def.$should_not_receive; delete def.$stub; delete def.$unstub; delete def.$stub_chain; delete def.$as_null_object; delete def['$null_object?']; return delete def['$received_message?'];}, TMP_9.$$s = self, TMP_9), $a).call($b); return ($a = ($c = $scope.get('Class')).$class_exec, $a.$$p = (TMP_10 = function(){var self = TMP_10.$$s || this; return delete def.$any_instance}, TMP_10.$$s = self, TMP_10), $a).call($c); }); $opal.defs(self, '$enable_expect', function(syntax_host) { var $a, $b, TMP_11, $c, TMP_14, self = this; if (syntax_host == null) { syntax_host = ((((Opal.get('RSpec')).$$scope.get('Mocks'))).$$scope.get('ExampleMethods')) } if ((($a = self['$expect_enabled?'](syntax_host)) !== nil && (!$a.$$is_boolean || $a == true))) { return nil}; ($a = ($b = syntax_host).$class_exec, $a.$$p = (TMP_11 = function(){var self = TMP_11.$$s || this, TMP_12, TMP_13; $opal.defn(self, '$receive', TMP_12 = function(method_name) { var self = this, $iter = TMP_12.$$p, block = $iter || nil; TMP_12.$$p = null; return (($scope.get('Matchers')).$$scope.get('Receive')).$new(method_name, block); }); $opal.defn(self, '$receive_messages', TMP_13 = function(message_return_value_hash) { var self = this, $iter = TMP_13.$$p, $yield = $iter || nil, matcher = nil; TMP_13.$$p = null; matcher = (($scope.get('Matchers')).$$scope.get('ReceiveMessages')).$new(message_return_value_hash); if (($yield !== nil)) { matcher.$warn_about_block()}; return matcher; }); $opal.defn(self, '$allow', function(target) { var self = this; return $scope.get('AllowanceTarget').$new(target); }); $opal.defn(self, '$expect_any_instance_of', function(klass) { var self = this; return $scope.get('AnyInstanceExpectationTarget').$new(klass); }); return ($opal.defn(self, '$allow_any_instance_of', function(klass) { var self = this; return $scope.get('AnyInstanceAllowanceTarget').$new(klass); }), nil) && 'allow_any_instance_of';}, TMP_11.$$s = self, TMP_11), $a).call($b); return ($a = ($c = (((((($scope.get('RSpec')).$$scope.get('Mocks'))).$$scope.get('ExampleMethods'))).$$scope.get('ExpectHost'))).$class_exec, $a.$$p = (TMP_14 = function(){var self = TMP_14.$$s || this; return ($opal.defn(self, '$expect', function(target) { var self = this; return $scope.get('ExpectationTarget').$new(target); }), nil) && 'expect'}, TMP_14.$$s = self, TMP_14), $a).call($c); }); $opal.defs(self, '$disable_expect', function(syntax_host) { var $a, $b, TMP_15, $c, TMP_16, self = this; if (syntax_host == null) { syntax_host = ((((Opal.get('RSpec')).$$scope.get('Mocks'))).$$scope.get('ExampleMethods')) } if ((($a = self['$expect_enabled?'](syntax_host)) !== nil && (!$a.$$is_boolean || $a == true))) { } else { return nil }; ($a = ($b = syntax_host).$class_exec, $a.$$p = (TMP_15 = function(){var self = TMP_15.$$s || this; delete def.$receive; delete def.$receive_messages; delete def.$allow; delete def.$expect_any_instance_of; return delete def.$allow_any_instance_of;}, TMP_15.$$s = self, TMP_15), $a).call($b); return ($a = ($c = (((((($scope.get('RSpec')).$$scope.get('Mocks'))).$$scope.get('ExampleMethods'))).$$scope.get('ExpectHost'))).$class_exec, $a.$$p = (TMP_16 = function(){var self = TMP_16.$$s || this; return delete def.$expect}, TMP_16.$$s = self, TMP_16), $a).call($c); }); $opal.defs(self, '$should_enabled?', function(syntax_host) { var self = this; if (syntax_host == null) { syntax_host = self.$default_should_syntax_host() } return syntax_host['$method_defined?']("should_receive"); }); $opal.defs(self, '$expect_enabled?', function(syntax_host) { var self = this; if (syntax_host == null) { syntax_host = ((((Opal.get('RSpec')).$$scope.get('Mocks'))).$$scope.get('ExampleMethods')) } return syntax_host['$method_defined?']("allow"); }); $opal.defs(self, '$default_should_syntax_host', function() { var $a, $b, $c, self = this; if ((($a = ($b = ($c = ($scope.JRUBY_VERSION != null), $c !== false && $c !== nil ?$scope.get('JRUBY_VERSION')['$==']("1.7.4") : $c), $b !== false && $b !== nil ?$scope.get('RUBY_VERSION').$to_f()['$>'](1.8) : $b)) !== nil && (!$a.$$is_boolean || $a == true))) { return Opal.get('BasicObject')}; if ((($a = ($opal.Object.$$scope.BasicObject == null ? nil : 'constant')) !== nil && (!$a.$$is_boolean || $a == true))) { } else { return $scope.get('Object') }; if ($scope.get('Object').$ancestors().$last()['$=='](Opal.get('BasicObject'))) { } else { return $scope.get('Object') }; return Opal.get('BasicObject'); }); })(self) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/mocks/targets"] = 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(['$new', '$define_method', '$===', '$raise_unsupported_matcher', '$define_matcher', '$to_proc', '$fetch', '$raise_negation_unsupported', '$private', '$__send__', '$raise', '$+', '$expression', '$name', '$class', '$delegate_to', '$disallow_negation', '$delegate_not_to']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Mocks'); var def = self.$$proto, $scope = self.$$scope; $opal.cdecl($scope, 'UnsupportedMatcherError', $scope.get('Class').$new($scope.get('StandardError'))); $opal.cdecl($scope, 'NegationUnsupportedError', $scope.get('Class').$new($scope.get('StandardError'))); (function($base, $super) { function $TargetBase(){}; var self = $TargetBase = $klass($base, $super, 'TargetBase', $TargetBase); var def = self.$$proto, $scope = self.$$scope, TMP_4; def.target = nil; def.$initialize = function(target) { var self = this; return self.target = target; }; $opal.defs(self, '$delegate_to', function(matcher_method) { var $a, $b, TMP_1, self = this; return ($a = ($b = self).$define_method, $a.$$p = (TMP_1 = function(matcher){var self = TMP_1.$$s || this, block, $a, $b; if (matcher == null) matcher = nil; block = TMP_1.$$p || nil, TMP_1.$$p = null; if ((($a = ((($b = (($scope.get('Matchers')).$$scope.get('Receive'))['$==='](matcher)) !== false && $b !== nil) ? $b : (($scope.get('Matchers')).$$scope.get('ReceiveMessages'))['$==='](matcher))) !== nil && (!$a.$$is_boolean || $a == true))) { } else { self.$raise_unsupported_matcher("to", matcher) }; return ($a = ($b = self).$define_matcher, $a.$$p = block.$to_proc(), $a).call($b, matcher, matcher_method);}, TMP_1.$$s = self, TMP_1), $a).call($b, "to"); }); $opal.defs(self, '$delegate_not_to', function(matcher_method, options) { var $a, $b, TMP_2, self = this, method_name = nil; if (options == null) { options = $hash2([], {}) } method_name = options.$fetch("from"); return ($a = ($b = self).$define_method, $a.$$p = (TMP_2 = function(matcher){var self = TMP_2.$$s || this, block, $a, $b, $case = nil; if (matcher == null) matcher = nil; block = TMP_2.$$p || nil, TMP_2.$$p = null; return (function() {$case = matcher;if ((($scope.get('Matchers')).$$scope.get('Receive'))['$===']($case)) {return ($a = ($b = self).$define_matcher, $a.$$p = block.$to_proc(), $a).call($b, matcher, matcher_method)}else if ((($scope.get('Matchers')).$$scope.get('ReceiveMessages'))['$===']($case)) {return self.$raise_negation_unsupported(method_name, matcher)}else {return self.$raise_unsupported_matcher(method_name, matcher)}})()}, TMP_2.$$s = self, TMP_2), $a).call($b, method_name); }); $opal.defs(self, '$disallow_negation', function(method_name) { var $a, $b, TMP_3, self = this; return ($a = ($b = self).$define_method, $a.$$p = (TMP_3 = function(matcher, args){var self = TMP_3.$$s || this; if (matcher == null) matcher = nil;args = $slice.call(arguments, 1); return self.$raise_negation_unsupported(method_name, matcher)}, TMP_3.$$s = self, TMP_3), $a).call($b, method_name); }); self.$private(); def.$define_matcher = TMP_4 = function(matcher, name) { var $a, $b, self = this, $iter = TMP_4.$$p, block = $iter || nil; TMP_4.$$p = null; return ($a = ($b = matcher).$__send__, $a.$$p = block.$to_proc(), $a).call($b, name, self.target); }; def.$raise_unsupported_matcher = function(method_name, matcher) { var self = this; return self.$raise($scope.get('UnsupportedMatcherError'), "only the `receive` or `receive_messages` matchers are supported "['$+']("with `" + (self.$expression()) + "(...)." + (method_name) + "`, but you have provided: " + (matcher))); }; def.$raise_negation_unsupported = function(method_name, matcher) { var self = this; return self.$raise($scope.get('NegationUnsupportedError'), ((((((("`") + (self.$expression())) + "(...).") + (method_name)) + " ") + (matcher.$name())) + "` is not supported since it ")['$+']("doesn't really make sense. What would it even mean?")); }; return (def.$expression = function() { var self = this; return ((self.$class()).$$scope.get('EXPRESSION')); }, nil) && 'expression'; })(self, null); (function($base, $super) { function $AllowanceTarget(){}; var self = $AllowanceTarget = $klass($base, $super, 'AllowanceTarget', $AllowanceTarget); var def = self.$$proto, $scope = self.$$scope; $opal.cdecl($scope, 'EXPRESSION', "allow"); self.$delegate_to("setup_allowance"); self.$disallow_negation("not_to"); return self.$disallow_negation("to_not"); })(self, $scope.get('TargetBase')); (function($base, $super) { function $ExpectationTarget(){}; var self = $ExpectationTarget = $klass($base, $super, 'ExpectationTarget', $ExpectationTarget); var def = self.$$proto, $scope = self.$$scope; $opal.cdecl($scope, 'EXPRESSION', "expect"); self.$delegate_to("setup_expectation"); self.$delegate_not_to("setup_negative_expectation", $hash2(["from"], {"from": "not_to"})); return self.$delegate_not_to("setup_negative_expectation", $hash2(["from"], {"from": "to_not"})); })(self, $scope.get('TargetBase')); (function($base, $super) { function $AnyInstanceAllowanceTarget(){}; var self = $AnyInstanceAllowanceTarget = $klass($base, $super, 'AnyInstanceAllowanceTarget', $AnyInstanceAllowanceTarget); var def = self.$$proto, $scope = self.$$scope; $opal.cdecl($scope, 'EXPRESSION', "allow_any_instance_of"); self.$delegate_to("setup_any_instance_allowance"); self.$disallow_negation("not_to"); return self.$disallow_negation("to_not"); })(self, $scope.get('TargetBase')); (function($base, $super) { function $AnyInstanceExpectationTarget(){}; var self = $AnyInstanceExpectationTarget = $klass($base, $super, 'AnyInstanceExpectationTarget', $AnyInstanceExpectationTarget); var def = self.$$proto, $scope = self.$$scope; $opal.cdecl($scope, 'EXPRESSION', "expect_any_instance_of"); self.$delegate_to("setup_any_instance_expectation"); self.$delegate_not_to("setup_any_instance_negative_expectation", $hash2(["from"], {"from": "not_to"})); return self.$delegate_not_to("setup_any_instance_negative_expectation", $hash2(["from"], {"from": "to_not"})); })(self, $scope.get('TargetBase')); })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/mocks/test_double"] = 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, $hash2 = $opal.hash2; $opal.add_stubs(['$extend', '$send', '$__initialize_as_test_double', '$as_null_object', '$__mock_proxy', '$null_object?', '$==', '$class', '$sprintf', '$object_id', '$inspect', '$gsub', '$alias_method', '$new', '$private', '$===', '$empty?', '$assign_stubs', '$record_message_received', '$to_proc', '$include?', '$raise', '$raise_unexpected_message_error', '$each_pair', '$add_simple_stub', '$proxy_for']); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Mocks'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'TestDouble'); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2; $opal.defs(self, '$extend_onto', function(object, name, stubs) { var self = this; if (name == null) { name = nil } if (stubs == null) { stubs = $hash2([], {}) } object.$extend(self); return object.$send("__initialize_as_test_double", name, stubs); }); def.$initialize = function(name, stubs) { var self = this; if (name == null) { name = nil } if (stubs == null) { stubs = $hash2([], {}) } return self.$__initialize_as_test_double(name, stubs); }; def.$as_null_object = function() { var self = this; return self.$__mock_proxy().$as_null_object(); }; def['$null_object?'] = function() { var self = this; return self.$__mock_proxy()['$null_object?'](); }; def['$=='] = function(other) { var self = this; return other['$=='](self.$__mock_proxy()); }; def.$inspect = function() { var self = this; if (self.name == null) self.name = nil; return "#<" + (self.$class()) + ":" + (self.$sprintf("0x%x", self.$object_id())) + " @name=" + (self.name.$inspect()) + ">"; }; def.$to_s = function() { var self = this; return self.$inspect().$gsub("<", "[").$gsub(">", "]"); }; self.$alias_method("to_str", "to_s"); def['$respond_to?'] = TMP_1 = function(message, incl_private) {var $zuper = $slice.call(arguments, 0); var $a, self = this, $iter = TMP_1.$$p, $yield = $iter || nil; if (incl_private == null) { incl_private = false } TMP_1.$$p = null; if ((($a = self.$__mock_proxy()['$null_object?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return true } else { return $opal.find_super_dispatcher(self, 'respond_to?', TMP_1, $iter).apply(self, $zuper) }; }; def.$__build_mock_proxy = function(order_group) { var self = this; if (self.name == null) self.name = nil; return $scope.get('Proxy').$new(self, order_group, self.name); }; self.$private(); def.$__initialize_as_test_double = function(name, stubs) { var $a, $b, self = this; if (name == null) { name = nil } if (stubs == null) { stubs = $hash2([], {}) } if ((($a = ($b = $scope.get('Hash')['$==='](name), $b !== false && $b !== nil ?stubs['$empty?']() : $b)) !== nil && (!$a.$$is_boolean || $a == true))) { stubs = name; self.name = nil; } else { self.name = name }; return self.$assign_stubs(stubs); }; def.$method_missing = TMP_2 = function(message, args) {var $zuper = $slice.call(arguments, 0); var $a, $b, self = this, $iter = TMP_2.$$p, block = $iter || nil, $case = nil; args = $slice.call(arguments, 1); TMP_2.$$p = null; if ((($a = self.$__mock_proxy()['$null_object?']()) !== nil && (!$a.$$is_boolean || $a == true))) { $case = message;if ("to_int"['$===']($case)) {return 0}else if ("to_a"['$===']($case) || "to_ary"['$===']($case)) {return nil}}; ($a = ($b = self.$__mock_proxy()).$record_message_received, $a.$$p = block.$to_proc(), $a).apply($b, [message].concat(args)); try { if ((($a = self.$__mock_proxy()['$null_object?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return self } else { return $opal.find_super_dispatcher(self, 'method_missing', TMP_2, $iter).apply(self, $zuper) } } catch ($err) {if ($opal.$rescue($err, [$scope.get('NameError')])) { if ((($a = ["to_a", "to_ary"]['$include?'](message)) !== nil && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('NoMethodError'))}; return ($a = self.$__mock_proxy()).$raise_unexpected_message_error.apply($a, [message].concat(args)); }else { throw $err; } }; }; def.$assign_stubs = function(stubs) { var $a, $b, TMP_3, self = this; return ($a = ($b = stubs).$each_pair, $a.$$p = (TMP_3 = function(message, response){var self = TMP_3.$$s || this; if (message == null) message = nil;if (response == null) response = nil; return self.$__mock_proxy().$add_simple_stub(message, response)}, TMP_3.$$s = self, TMP_3), $a).call($b); }; def.$__mock_proxy = function() { var self = this; return ((Opal.get('RSpec')).$$scope.get('Mocks')).$proxy_for(self); }; ;$opal.donate(self, ["$initialize", "$as_null_object", "$null_object?", "$==", "$inspect", "$to_s", "$respond_to?", "$__build_mock_proxy", "$__initialize_as_test_double", "$method_missing", "$assign_stubs", "$__mock_proxy"]); })(self) })(self) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/mocks/verifying_double"] = 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', '$null_object?', '$ensure_implemented', '$__mock_proxy', '$include', '$__initialize_as_test_double', '$new', '$stub', '$const_to_replace']); self.$require("rspec/mocks/mock"); self.$require("rspec/mocks/verifying_proxy"); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Mocks'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'VerifyingDouble'); var def = self.$$proto, $scope = self.$$scope, TMP_1; def.$method_missing = TMP_1 = function(message, args) {var $zuper = $slice.call(arguments, 0); var $a, self = this, $iter = TMP_1.$$p, block = $iter || nil; args = $slice.call(arguments, 1); TMP_1.$$p = null; if ((($a = self['$null_object?']()) !== nil && (!$a.$$is_boolean || $a == true))) { self.$__mock_proxy().$ensure_implemented(message)}; return $opal.find_super_dispatcher(self, 'method_missing', TMP_1, $iter).apply(self, $zuper); } ;$opal.donate(self, ["$method_missing"]); })(self); (function($base, $super) { function $InstanceVerifyingDouble(){}; var self = $InstanceVerifyingDouble = $klass($base, $super, 'InstanceVerifyingDouble', $InstanceVerifyingDouble); var def = self.$$proto, $scope = self.$$scope; def.doubled_module = nil; self.$include($scope.get('TestDouble')); self.$include($scope.get('VerifyingDouble')); def.$initialize = function(doubled_module, args) { var $a, self = this; args = $slice.call(arguments, 1); self.doubled_module = doubled_module; return ($a = self).$__initialize_as_test_double.apply($a, [doubled_module].concat(args)); }; return (def.$__build_mock_proxy = function(order_group) { var self = this; return $scope.get('VerifyingProxy').$new(self, order_group, self.doubled_module, $scope.get('InstanceMethodReference')); }, nil) && '__build_mock_proxy'; })(self, null); (function($base) { var self = $module($base, 'ObjectVerifyingDoubleMethods'); var def = self.$$proto, $scope = self.$$scope; self.$include($scope.get('TestDouble')); self.$include($scope.get('VerifyingDouble')); def.$initialize = function(doubled_module, args) { var $a, self = this; args = $slice.call(arguments, 1); self.doubled_module = doubled_module; return ($a = self).$__initialize_as_test_double.apply($a, [doubled_module].concat(args)); }; def.$__build_mock_proxy = function(order_group) { var self = this; if (self.doubled_module == null) self.doubled_module = nil; return $scope.get('VerifyingProxy').$new(self, order_group, self.doubled_module, $scope.get('ObjectMethodReference')); }; def.$as_stubbed_const = function(options) { var self = this; if (self.doubled_module == null) self.doubled_module = nil; if (options == null) { options = $hash2([], {}) } $scope.get('ConstantMutator').$stub(self.doubled_module.$const_to_replace(), self, options); return self; }; ;$opal.donate(self, ["$initialize", "$__build_mock_proxy", "$as_stubbed_const"]); })(self); (function($base, $super) { function $ObjectVerifyingDouble(){}; var self = $ObjectVerifyingDouble = $klass($base, $super, 'ObjectVerifyingDouble', $ObjectVerifyingDouble); var def = self.$$proto, $scope = self.$$scope; return self.$include($scope.get('ObjectVerifyingDoubleMethods')) })(self, null); (function($base, $super) { function $ClassVerifyingDouble(){}; var self = $ClassVerifyingDouble = $klass($base, $super, 'ClassVerifyingDouble', $ClassVerifyingDouble); var def = self.$$proto, $scope = self.$$scope; return self.$include($scope.get('ObjectVerifyingDoubleMethods')) })(self, $scope.get('Module')); })(self) })(self); }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/mocks/verifying_message_expecation"] = 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_accessor', '$===', '$first', '$>', '$length', '$ensure_arity!', '$private', '$nil?', '$method_reference', '$when_defined', '$new', '$within_range?', '$raise_arity_error']); self.$require("rspec/mocks/arity_calculator"); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Mocks'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $VerifyingMessageExpectation(){}; var self = $VerifyingMessageExpectation = $klass($base, $super, 'VerifyingMessageExpectation', $VerifyingMessageExpectation); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2; self.$attr_accessor("method_reference"); def.$initialize = TMP_1 = function(args) {var $zuper = $slice.call(arguments, 0); var self = this, $iter = TMP_1.$$p, $yield = $iter || nil; args = $slice.call(arguments, 0); TMP_1.$$p = null; return $opal.find_super_dispatcher(self, 'initialize', TMP_1, $iter).apply(self, $zuper); }; def.$with = TMP_2 = function(args) {var $zuper = $slice.call(arguments, 0); var $a, self = this, $iter = TMP_2.$$p, block = $iter || nil, expected_arity = nil; args = $slice.call(arguments, 0); TMP_2.$$p = null; if ((($a = (($scope.get('ArgumentMatchers')).$$scope.get('AnyArgsMatcher'))['$==='](args.$first())) !== nil && (!$a.$$is_boolean || $a == true))) { } else { expected_arity = (function() {if ((($a = (($scope.get('ArgumentMatchers')).$$scope.get('NoArgsMatcher'))['$==='](args.$first())) !== nil && (!$a.$$is_boolean || $a == true))) { return 0 } else if (args.$length()['$>'](0)) { return args.$length() } else { return $opal.find_super_dispatcher(self, 'with', TMP_2, $iter).apply(self, $zuper) }; return nil; })(); self['$ensure_arity!'](expected_arity); }; return $opal.find_super_dispatcher(self, 'with', TMP_2, $iter).apply(self, $zuper); }; self.$private(); return (def['$ensure_arity!'] = function(actual) { var $a, $b, TMP_3, self = this; if ((($a = self.$method_reference()['$nil?']()) !== nil && (!$a.$$is_boolean || $a == true))) { return nil}; return ($a = ($b = self.$method_reference()).$when_defined, $a.$$p = (TMP_3 = function(method){var self = TMP_3.$$s || this, $a, calculator = nil; if (self.error_generator == null) self.error_generator = nil; if (method == null) method = nil; calculator = $scope.get('ArityCalculator').$new(method); if ((($a = calculator['$within_range?'](actual)) !== nil && (!$a.$$is_boolean || $a == true))) { return nil } else { self.failed_fast = true; return self.error_generator.$raise_arity_error(calculator, actual); };}, TMP_3.$$s = self, TMP_3), $a).call($b); }, nil) && 'ensure_arity!'; })(self, $scope.get('MessageExpectation')) })(self) })(self); }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/mocks/verifying_proxy"] = 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, $hash2 = $opal.hash2, $klass = $opal.klass; $opal.add_stubs(['$require', '$ensure_implemented', '$defined?', '$when_unimplemented', '$raise_unimplemented_error', '$[]', '$method_reference', '$include', '$new', '$[]=', '$tap', '$method_reference=', '$ensure_arity!', '$length', '$private', '$when_defined', '$within_range?', '$raise', '$arity', '$respond_to?', '$save_original_method!', '$original_method']); self.$require("rspec/mocks/verifying_message_expecation"); self.$require("rspec/mocks/method_reference"); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Mocks'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'VerifyingProxyMethods'); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3; def.$add_stub = TMP_1 = function(location, method_name, opts) {var $zuper = $slice.call(arguments, 0); var self = this, $iter = TMP_1.$$p, implementation = $iter || nil; if (opts == null) { opts = $hash2([], {}) } TMP_1.$$p = null; self.$ensure_implemented(method_name); return $opal.find_super_dispatcher(self, 'add_stub', TMP_1, $iter).apply(self, $zuper); }; def.$add_simple_stub = TMP_2 = function(method_name, args) {var $zuper = $slice.call(arguments, 0); var self = this, $iter = TMP_2.$$p, $yield = $iter || nil; args = $slice.call(arguments, 1); TMP_2.$$p = null; self.$ensure_implemented(method_name); return $opal.find_super_dispatcher(self, 'add_simple_stub', TMP_2, $iter).apply(self, $zuper); }; def.$add_message_expectation = TMP_3 = function(location, method_name, opts) {var $zuper = $slice.call(arguments, 0); var self = this, $iter = TMP_3.$$p, block = $iter || nil; if (opts == null) { opts = $hash2([], {}) } TMP_3.$$p = null; self.$ensure_implemented(method_name); return $opal.find_super_dispatcher(self, 'add_message_expectation', TMP_3, $iter).apply(self, $zuper); }; def.$ensure_implemented = function(method_name) { var $a, $b, TMP_4, self = this; if (self.doubled_module == null) self.doubled_module = nil; if ((($a = self.doubled_module['$defined?']()) !== nil && (!$a.$$is_boolean || $a == true))) { } else { return nil }; return ($a = ($b = self.$method_reference()['$[]'](method_name)).$when_unimplemented, $a.$$p = (TMP_4 = function(){var self = TMP_4.$$s || this; if (self.error_generator == null) self.error_generator = nil; if (self.doubled_module == null) self.doubled_module = nil; return self.error_generator.$raise_unimplemented_error(self.doubled_module, method_name)}, TMP_4.$$s = self, TMP_4), $a).call($b); }; ;$opal.donate(self, ["$add_stub", "$add_simple_stub", "$add_message_expectation", "$ensure_implemented"]); })(self); (function($base, $super) { function $VerifyingProxy(){}; var self = $VerifyingProxy = $klass($base, $super, 'VerifyingProxy', $VerifyingProxy); var def = self.$$proto, $scope = self.$$scope, TMP_5; def.method_reference = nil; self.$include($scope.get('VerifyingProxyMethods')); def.$initialize = TMP_5 = function(object, order_group, name, method_reference_class) { var $a, $b, TMP_6, self = this, $iter = TMP_5.$$p, $yield = $iter || nil; TMP_5.$$p = null; $opal.find_super_dispatcher(self, 'initialize', TMP_5, null).apply(self, [object, order_group]); self.object = object; self.doubled_module = name; self.method_reference_class = method_reference_class; return self.method_doubles = ($a = ($b = $scope.get('Hash')).$new, $a.$$p = (TMP_6 = function(h, k){var self = TMP_6.$$s || this; if (self.object == null) self.object = nil; if (h == null) h = nil;if (k == null) k = nil; return h['$[]='](k, $scope.get('VerifyingMethodDouble').$new(self.object, k, self, self.$method_reference()['$[]'](k)))}, TMP_6.$$s = self, TMP_6), $a).call($b); }; return (def.$method_reference = function() { var $a, $b, $c, TMP_7, self = this; return ((($a = self.method_reference) !== false && $a !== nil) ? $a : self.method_reference = ($b = ($c = $scope.get('Hash')).$new, $b.$$p = (TMP_7 = function(h, k){var self = TMP_7.$$s || this; if (self.method_reference_class == null) self.method_reference_class = nil; if (self.doubled_module == null) self.doubled_module = nil; if (h == null) h = nil;if (k == null) k = nil; return h['$[]='](k, self.method_reference_class.$new(self.doubled_module, k))}, TMP_7.$$s = self, TMP_7), $b).call($c)); }, nil) && 'method_reference'; })(self, $scope.get('Proxy')); (function($base, $super) { function $VerifyingPartialMockProxy(){}; var self = $VerifyingPartialMockProxy = $klass($base, $super, 'VerifyingPartialMockProxy', $VerifyingPartialMockProxy); var def = self.$$proto, $scope = self.$$scope, TMP_8; def.method_doubles = nil; self.$include($scope.get('VerifyingProxyMethods')); def.$initialize = TMP_8 = function(object, expectation_ordering) { var $a, $b, TMP_9, self = this, $iter = TMP_8.$$p, $yield = $iter || nil; TMP_8.$$p = null; $opal.find_super_dispatcher(self, 'initialize', TMP_8, null).apply(self, [object, expectation_ordering]); self.doubled_module = $scope.get('DirectObjectReference').$new(object); return self.method_doubles = ($a = ($b = $scope.get('Hash')).$new, $a.$$p = (TMP_9 = function(h, k){var self = TMP_9.$$s || this; if (h == null) h = nil;if (k == null) k = nil; return h['$[]='](k, $scope.get('VerifyingExistingMethodDouble').$new(object, k, self))}, TMP_9.$$s = self, TMP_9), $a).call($b); }; return (def.$method_reference = function() { var self = this; return self.method_doubles; }, nil) && 'method_reference'; })(self, $scope.get('PartialMockProxy')); (function($base, $super) { function $VerifyingMethodDouble(){}; var self = $VerifyingMethodDouble = $klass($base, $super, 'VerifyingMethodDouble', $VerifyingMethodDouble); var def = self.$$proto, $scope = self.$$scope, TMP_10, TMP_12, TMP_13; def.method_reference = nil; def.$initialize = TMP_10 = function(object, method_name, proxy, method_reference) { var self = this, $iter = TMP_10.$$p, $yield = $iter || nil; TMP_10.$$p = null; $opal.find_super_dispatcher(self, 'initialize', TMP_10, null).apply(self, [object, method_name, proxy]); return self.method_reference = method_reference; }; def.$message_expectation_class = function() { var self = this; return $scope.get('VerifyingMessageExpectation'); }; def.$add_expectation = TMP_12 = function(arg) {var $zuper = $slice.call(arguments, 0); var $a, $b, TMP_11, self = this, $iter = TMP_12.$$p, $yield = $iter || nil; arg = $slice.call(arguments, 0); TMP_12.$$p = null; return ($a = ($b = $opal.find_super_dispatcher(self, 'add_expectation', TMP_12, $iter).apply(self, $zuper)).$tap, $a.$$p = (TMP_11 = function(x){var self = TMP_11.$$s || this, $a, $b; if (self.method_reference == null) self.method_reference = nil; if (x == null) x = nil; return (($a = [self.method_reference]), $b = x, $b['$method_reference='].apply($b, $a), $a[$a.length-1])}, TMP_11.$$s = self, TMP_11), $a).call($b); }; def.$proxy_method_invoked = TMP_13 = function(obj, args) {var $zuper = $slice.call(arguments, 0); var self = this, $iter = TMP_13.$$p, block = $iter || nil; args = $slice.call(arguments, 1); TMP_13.$$p = null; self['$ensure_arity!'](args.$length()); return $opal.find_super_dispatcher(self, 'proxy_method_invoked', TMP_13, $iter).apply(self, $zuper); }; self.$private(); return (def['$ensure_arity!'] = function(arity) { var $a, $b, TMP_14, self = this; return ($a = ($b = self.method_reference).$when_defined, $a.$$p = (TMP_14 = function(method){var self = TMP_14.$$s || this, $a, calculator = nil; if (method == null) method = nil; calculator = $scope.get('ArityCalculator').$new(method); if ((($a = calculator['$within_range?'](arity)) !== nil && (!$a.$$is_boolean || $a == true))) { return nil } else { return self.$raise($scope.get('ArgumentError'), "wrong number of arguments (" + (arity) + " for " + (method.$arity()) + ")") };}, TMP_14.$$s = self, TMP_14), $a).call($b); }, nil) && 'ensure_arity!'; })(self, $scope.get('MethodDouble')); (function($base, $super) { function $VerifyingExistingMethodDouble(){}; var self = $VerifyingExistingMethodDouble = $klass($base, $super, 'VerifyingExistingMethodDouble', $VerifyingExistingMethodDouble); var def = self.$$proto, $scope = self.$$scope, TMP_15, TMP_16, TMP_17; def.valid_method = nil; def.$initialize = TMP_15 = function(object, method_name, proxy) { var self = this, $iter = TMP_15.$$p, $yield = $iter || nil; TMP_15.$$p = null; $opal.find_super_dispatcher(self, 'initialize', TMP_15, null).apply(self, [object, method_name, proxy, self]); self.valid_method = object['$respond_to?'](method_name); return self['$save_original_method!'](); }; def.$when_defined = TMP_16 = function() { var $a, self = this, $iter = TMP_16.$$p, $yield = $iter || nil; TMP_16.$$p = null; return $a = $opal.$yield1($yield, self.$original_method()), $a === $breaker ? $a : $a; }; return (def.$when_unimplemented = TMP_17 = function() { var $a, self = this, $iter = TMP_17.$$p, $yield = $iter || nil; TMP_17.$$p = null; if ((($a = self.valid_method) !== nil && (!$a.$$is_boolean || $a == true))) { return nil } else { return $a = $opal.$yieldX($yield, []), $a === $breaker ? $a : $a }; }, nil) && 'when_unimplemented'; })(self, $scope.get('VerifyingMethodDouble')); })(self) })(self); }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/mocks/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, 'Mocks'); 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) })(self) }; /* Generated by Opal 0.7.0.dev */ Opal.modules["rspec/mocks"] = 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, $hash2 = $opal.hash2; $opal.add_stubs(['$require', '$attr_accessor', '$class_exec', '$include', '$space', '$space=', '$new', '$verify_all', '$reset_all', '$proxy_for', '$proxies_of', '$any_instance_recorder_for', '$fetch', '$first_non_rspec_line', '$add_stub', '$to_proc', '$add_message_expectation', '$instance_method', '$===', '$call', '$bind', '$method']); self.$require("rspec/mocks/framework"); self.$require("rspec/mocks/version"); return (function($base) { var self = $module($base, 'RSpec'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var self = $module($base, 'Mocks'); var def = self.$$proto, $scope = self.$$scope; (function(self) { var $scope = self.$$scope, def = self.$$proto; self.$attr_accessor("space"); self.$$proto.$setup = function(host) { var $a, $b, TMP_1, $c, self = this; ($a = ($b = ((function(self) { var $scope = self.$$scope, def = self.$$proto; return self })(host.$singleton_class()))).$class_exec, $a.$$p = (TMP_1 = function(){var self = TMP_1.$$s || this; return self.$include((((($scope.get('RSpec')).$$scope.get('Mocks'))).$$scope.get('ExampleMethods')))}, TMP_1.$$s = self, TMP_1), $a).call($b); return ($a = self, ((($c = $a.$space()) !== false && $c !== nil) ? $c : $a['$space=']((((($scope.get('RSpec')).$$scope.get('Mocks'))).$$scope.get('Space')).$new()))); }; self.$$proto.$verify = function() { var self = this; return self.$space().$verify_all(); }; self.$$proto.$teardown = function() { var self = this; return self.$space().$reset_all(); }; self.$$proto.$proxy_for = function(object) { var self = this; return self.$space().$proxy_for(object); }; self.$$proto.$proxies_of = function(klass) { var self = this; return self.$space().$proxies_of(klass); }; self.$$proto.$any_instance_recorder_for = function(klass) { var self = this; return self.$space().$any_instance_recorder_for(klass); }; self.$$proto.$allow_message = TMP_2 = function(subject, message, opts) { var $a, $b, TMP_3, $c, self = this, $iter = TMP_2.$$p, block = $iter || nil, orig_caller = nil; if (opts == null) { opts = $hash2([], {}) } TMP_2.$$p = null; orig_caller = ($a = ($b = opts).$fetch, $a.$$p = (TMP_3 = function(){var self = TMP_3.$$s || this; return $scope.get('CallerFilter').$first_non_rspec_line()}, TMP_3.$$s = self, TMP_3), $a).call($b, "expected_from"); return ($a = ($c = ((Opal.get('RSpec')).$$scope.get('Mocks')).$proxy_for(subject)).$add_stub, $a.$$p = block.$to_proc(), $a).call($c, orig_caller, message, opts); }; self.$$proto.$expect_message = TMP_4 = function(subject, message, opts) { var $a, $b, TMP_5, $c, self = this, $iter = TMP_4.$$p, block = $iter || nil, orig_caller = nil; if (opts == null) { opts = $hash2([], {}) } TMP_4.$$p = null; orig_caller = ($a = ($b = opts).$fetch, $a.$$p = (TMP_5 = function(){var self = TMP_5.$$s || this; return $scope.get('CallerFilter').$first_non_rspec_line()}, TMP_5.$$s = self, TMP_5), $a).call($b, "expected_from"); return ($a = ($c = ((Opal.get('RSpec')).$$scope.get('Mocks')).$proxy_for(subject)).$add_message_expectation, $a.$$p = block.$to_proc(), $a).call($c, orig_caller, message, opts); }; $opal.cdecl($scope, 'KERNEL_METHOD_METHOD', Opal.get('Kernel').$instance_method("method")); return (self.$$proto.$method_handle_for = function(object, method_name) { var $a, self = this; if ((($a = Opal.get('Kernel')['$==='](object)) !== nil && (!$a.$$is_boolean || $a == true))) { return $scope.get('KERNEL_METHOD_METHOD').$bind(object).$call(method_name) } else { return object.$method(method_name) }; }, nil) && 'method_handle_for'; })(self.$singleton_class()); $opal.cdecl($scope, 'IGNORED_BACKTRACE_LINE', "this backtrace line is ignored"); })(self) })(self); }; /* Generated by Opal 0.7.0.dev */ Opal.modules["shellwords"] = function($opal) { $opal.dynamic_require_severity = "error"; var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice; $opal.add_stubs([]); return nil }; /* Generated by Opal 0.7.0.dev */ Opal.modules["fileutils"] = function($opal) { $opal.dynamic_require_severity = "error"; var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice; $opal.add_stubs([]); return nil }; /* Generated by Opal 0.7.0.dev */ Opal.modules["optparse"] = function($opal) { $opal.dynamic_require_severity = "error"; var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice; $opal.add_stubs([]); return nil };