Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

[#1002] Made sure our registry updates when a manifest is specified as t... #25

Merged
merged 2 commits into from

4 participants

@dseif
Owner

...he third arguement of the plugin constructor

test/popcorn.unit.js
((28 lines not shown))
+ end: function() {}
+ };
+ }, manifest );
+
+ var p = Popcorn( "#video" );
+ p.test({});
+ ok( Popcorn.manifest[ "test" ], "The test plugin exists in Popcorn.manifest" );
+ plus();
+ ok( Popcorn.registry[ 0 ].base[ "manifest" ], "A manifest exists in the registry for the test plugin" );
+ plus();
+ ok( Popcorn.registryByName[ "test" ].base[ "manifest" ], "Popcorn.registryByName contains the test plugins manifest" );
+ plus();
+ deepEqual( Popcorn.registry[ 0 ].base.manifest, manifest, "The specified that we defined equals the one in the registry" );
+ plus();
+});
+
@rwaldron Owner
rwaldron added a note

This test doesn't need to use the plus() mechanism, it's 100% synchronous.

@jbuck Owner
jbuck added a note

yeah, you can just remove stop(), the plus() calls and the plus() function itself

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
test/popcorn.unit.js
((25 lines not shown))
+
+ return {
+ start: function() {},
+ end: function() {}
+ };
+ }, manifest );
+
+ var p = Popcorn( "#video" );
+ p.test({});
+ ok( Popcorn.manifest[ "test" ], "The test plugin exists in Popcorn.manifest" );
+ plus();
+ ok( Popcorn.registry[ 0 ].base[ "manifest" ], "A manifest exists in the registry for the test plugin" );
+ plus();
+ ok( Popcorn.registryByName[ "test" ].base[ "manifest" ], "Popcorn.registryByName contains the test plugins manifest" );
+ plus();
+ deepEqual( Popcorn.registry[ 0 ].base.manifest, manifest, "The specified that we defined equals the one in the registry" );
@cadecairos Owner

The success message should be updated for clarity.

@dseif Owner
dseif added a note

Haha thanks, that's some pretty bad engrish right thur.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
test/popcorn.unit.js
@@ -1690,6 +1690,46 @@ test( "Manifest removal", function() {
popcorn.destroy();
});
+test( "Manifest updates registry and registryByName", function() {
@jbuck Owner
jbuck added a note

You can put 4 in as the second parameter, which will do the expects

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@rwaldron
Owner

SR+!

@dseif dseif merged commit f2a3b6a into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 9, 2012
  1. @dseif

    [#1002] Made sure our registry updates when a manifest is specified a…

    dseif authored
    …s the third arguement of the plugin constructor
Commits on Apr 25, 2012
  1. @dseif
This page is out of date. Refresh to see the latest.
Showing with 34 additions and 0 deletions.
  1. +8 −0 popcorn.js
  2. +26 −0 test/popcorn.unit.js
View
8 popcorn.js
@@ -1451,6 +1451,14 @@
mergedSetupOpts );
};
+ // if the manifest parameter exists we should extend it onto the definition object
+ // so that it shows up when calling Popcorn.registry and Popcorn.registryByName
+ if ( manifest ) {
+ Popcorn.extend( definition, {
+ manifest: manifest
+ });
+ }
+
// Push into the registry
var entry = {
fn: plugin[ name ],
View
26 test/popcorn.unit.js
@@ -1690,6 +1690,32 @@ test( "Manifest removal", function() {
popcorn.destroy();
});
+test( "Manifest updates registry and registryByName", 4, function() {
+
+ var count = 0,
+ manifest = {
+ obj: {
+ test: 1
+ },
+ val: 2
+ };
+
+ Popcorn.plugin( "test", function() {
+
+ return {
+ start: function() {},
+ end: function() {}
+ };
+ }, manifest );
+
+ var p = Popcorn( "#video" );
+ p.test({});
+ ok( Popcorn.manifest[ "test" ], "The test plugin exists in Popcorn.manifest" );
+ ok( Popcorn.registry[ 0 ].base[ "manifest" ], "A manifest exists in the registry for the test plugin" );
+ ok( Popcorn.registryByName[ "test" ].base[ "manifest" ], "Popcorn.registryByName contains the test plugins manifest" );
+ deepEqual( Popcorn.registry[ 0 ].base.manifest, manifest, "The created manifest is equal to the one in the registry" );
+});
+
test( "Configurable Defaults", function() {
var expects = 14,
Something went wrong with that request. Please try again.