ensured uri is scoped in a few tests
authorNeil Kandalgaonkar <neilk@users.mediawiki.org>
Mon, 10 Oct 2011 21:33:00 +0000 (21:33 +0000)
committerNeil Kandalgaonkar <neilk@users.mediawiki.org>
Mon, 10 Oct 2011 21:33:00 +0000 (21:33 +0000)
tests/jasmine/spec/mediawiki.Uri.spec.js

index 9171cdc..978ab6d 100644 (file)
 
                it( "should throw error on no arguments to constructor", function() {
                        expect( function() { 
-                               uri = new mw.Uri();
+                               var uri = new mw.Uri();
                        } ).toThrow( "Bad constructor arguments" );
                } );
 
                it( "should throw error on empty string as argument to constructor", function() {
                        expect( function() { 
-                               uri = new mw.Uri( '' );
+                               var uri = new mw.Uri( '' );
                        } ).toThrow( "Bad constructor arguments" );
                } );
 
                it( "should throw error on non-URI as argument to constructor", function() {
                        expect( function() { 
-                               uri = new mw.Uri( 'glaswegian penguins' );
+                               var uri = new mw.Uri( 'glaswegian penguins' );
                        } ).toThrow( "Bad constructor arguments" );
                } );
 
                it( "should throw error on improper URI as argument to constructor", function() {
                        expect( function() { 
-                               uri = new mw.Uri( 'http:/foo.com' );
+                               var uri = new mw.Uri( 'http:/foo.com' );
                        } ).toThrow( "Bad constructor arguments" );
                } );
 
                it( "should throw error on URI without protocol as argument to constructor", function() {
                        expect( function() { 
-                               uri = new mw.Uri( 'foo.com/bar/baz' );
+                               var uri = new mw.Uri( 'foo.com/bar/baz' );
                        } ).toThrow( "Bad constructor arguments" );
                } );
 
-
        } );
 
 } )();