Sha256: 9b91ce479351aad692c296f265cccdc0e317887ffd2a16b6fa5747a72b2cec38

Contents?: true

Size: 885 Bytes

Versions: 1

Compression:

Stored size: 885 Bytes

Contents

if (!window.shenandoah) { shenandoah = { }; }

(function ($) {
  shenandoah.MultirunnerFrame = function () {
    // Finds the IFRAME which contains this window in the parent DOM
    var containingFrame = $.grep(window.parent.jQuery('iframe'), function (iframe, idx) {
      return iframe.contentWindow === window;
    })[0];

    function parentTrigger(name, data) {
      if (containingFrame) {
        window.parent.jQuery(containingFrame).trigger(name, data);
      }
    }

    this.register = function () {
      $(Screw).bind('after', function () {
        parentTrigger('complete', {
          passed_count: $('.passed').length,
          failed_count: $('.failed').length,
          total_count: $('.passed').length + $('.failed').length
        });
      });
    };
  };


  $(document).ready(function () {
    new shenandoah.MultirunnerFrame().register();
  });

}(jQuery));

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
shenandoah-0.2.0 lib/shenandoah/javascript/browser/multirunner-single.js