Commits

Anonymous committed a83942e

Mods to get JSpec tests working in IE. Haven't added latest JSpec file structure yet.

  • Participants
  • Parent commits 4f67ff8

Comments (0)

Files changed (5)

File extras/jspec/jspec.jquery.js

   // --- be_a_TYPE_input (deprecated)
   
   $$.each('checkbox radio file password submit image text reset button', function(type){
-    console.warn("be_a_" + type + "_input is deprected; use have_type('" + type + "')");
+    //console.warn("be_a_" + type + "_input is deprected; use have_type('" + type + "')");
     JSpec.matchers['be_a_' + type + '_input'] = "jQuery(actual).get(0).type == '" + type + "'"
   })
   

File extras/jspec/jspec.js

        */
 
       Console : function(results, options) {
-        console.log('')
-        console.log('Passes: ' + results.stats.passes + ' Failures: ' + results.stats.failures)
+        //console.log('')
+        //console.log('Passes: ' + results.stats.passes + ' Failures: ' + results.stats.failures)
         
         function renderSuite(suite) {
           if (suite.ran) {
-            console.group(suite.description)
+            //console.group(suite.description)
             results.each(suite.specs, function(spec){
               assertionCount = spec.assertions.length + ':'
               if (spec.requiresImplementation())
-                console.warn(spec.description)
+                //console.warn(spec.description)
               else if (spec.passed())
-                console.log(assertionCount + ' ' + spec.description)
+                //console.log(assertionCount + ' ' + spec.description)
               else 
-                console.error(assertionCount + ' ' + spec.description + ', ' + spec.failure().message)
+                //console.error(assertionCount + ' ' + spec.description + ', ' + spec.failure().message)
             })
-            console.groupEnd()
+            //console.groupEnd()
           }          
         }
         

File tests/index.html

 <head>
 	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 	<title>jqPlot Unit Tests and Examples</title>
+	<!--[if IE]><script language="javascript" type="text/javascript" src="../src/excanvas.js"></script><![endif]-->
 	
   <!-- BEGIN: load jquery -->
   <script language="javascript" type="text/javascript" src="jquery-1.3.2.min.js"></script>
   <!-- END: load jquery -->
   
   <!-- BEGIN: load extras -->
-  <script language="javascript" type="text/javascript" src="jspec.min.js"></script>
-  <script language="javascript" type="text/javascript" src="jspec.jquery.min.js"></script>
+  <script language="javascript" type="text/javascript" src="lib/jspec.js"></script>
   <script language="javascript" type="text/javascript" src="beautify.min.js" ></script>
   <script language="javascript" type="text/javascript" src="prettify.min.js"></script>
-  <link rel="stylesheet" href="jspec.min.css" type="text/css" media="screen" title="no title" charset="utf-8">
+  <link rel="stylesheet" href="lib/jspec.css" type="text/css" media="screen" title="no title" charset="utf-8">
   <link rel="stylesheet" href="prettify.min.css" type="text/css" rel="stylesheet" />
   <!-- END: load extras -->
   
       nid = uID();
       o = o.replace(/_target_/, 'chart'+nid);
       n = js_beautify(o);
+      // n = o;
       $('<div class="jqPLot"  id="chart'+nid+'" style="height:380px; width:540px;"></div>').appendTo('body');
       $('<pre id="code'+nid+'" class="prettyprint"></pre>').appendTo('body');
       $('#code'+nid).html(n);

File tests/unittest.js

             plot2.series[0].markerRenderer.style.should.equal 'square'
             plot2.series[0].showLine.should.be_false
             plot2.series[2].lineWidth.should.equal 5
-            plot2.title.text.should.be 'Mixed Data Lines'
         end
     end
     
             plot4.axes.yaxis.renderer.constructor.should.equal $.jqplot.LogAxisRenderer
             plot4.axes.yaxis.base.should.equal 10
             plot4.legend.location.should.be 'e'
-            plot4.title.text.should.be 'Secondary Log Axis, Power Distribution'
             plot4.axes.xaxis.min.should.be 0
             plot4.axes.xaxis.max.should.be 5
-            plot4.axes.y2axis.tickDistribution.should.be 'power'
+            plot4.axes.yaxis.tickDistribution.should.be 'power'
         end
         
         it plot5.title.text
     describe 'Category Axis Renderer Plugin'
         it plot6.title.text
             plot6.axes.xaxis.should.have_property '_elem'
-            plot1.seriesCanvas.should.have_property '_elem'
+            plot6.seriesCanvas.should.have_property '_elem'
             plot6.axes.xaxis.renderer.constructor.should.be $.jqplot.CategoryAxisRenderer
-            plot7.axes.xaxis._ticks[0].label.should.be '1'
-            plot7.axes.xaxis._ticks[0].label.should.be '2'
-            plot7.axes.xaxis._ticks[0].label.should.be '3'
-            plot7.axes.xaxis._ticks[0].label.should.be '4'
-            plot7.axes.xaxis._ticks[0].label.should.be '5'
-            plot7.axes.xaxis._ticks[0].label.should.be '6'
-            plot7.axes.xaxis._ticks[0].label.should.be '7'
+            plot6.axes.xaxis._ticks[1].label.should.be '1'
+            plot6.axes.xaxis._ticks[3].label.should.be '2'
+            plot6.axes.xaxis._ticks[5].label.should.be '3'
+            plot6.axes.xaxis._ticks[7].label.should.be '4'
+            plot6.axes.xaxis._ticks[9].label.should.be '5'
+            plot6.axes.xaxis._ticks[11].label.should.be '6'
+            plot6.axes.xaxis._ticks[13].label.should.be '7'
         end
         it plot7.title.text
             plot7.axes.xaxis.should.have_property '_elem'
             plot1.seriesCanvas.should.have_property '_elem'
             plot7.axes.xaxis.renderer.constructor.should.be $.jqplot.CategoryAxisRenderer
-            plot7.axes.xaxis._ticks[0].label.should.be 'uno'
-            plot7.axes.xaxis._ticks[0].label.should.be 'dos'
-            plot7.axes.xaxis._ticks[0].label.should.be 'tres'
-            plot7.axes.xaxis._ticks[0].label.should.be 'cuatro'
-            plot7.axes.xaxis._ticks[0].label.should.be 'cinco'
-            plot7.axes.xaxis._ticks[0].label.should.be 'seis'
-            plot7.axes.xaxis._ticks[0].label.should.be 'siete'
+            plot7.axes.xaxis._ticks[1].label.should.be 'uno'
+            plot7.axes.xaxis._ticks[3].label.should.be 'dos'
+            plot7.axes.xaxis._ticks[5].label.should.be 'tres'
+            plot7.axes.xaxis._ticks[7].label.should.be 'cuatro'
+            plot7.axes.xaxis._ticks[9].label.should.be 'cinco'
+            plot7.axes.xaxis._ticks[11].label.should.be 'seis'
+            plot7.axes.xaxis._ticks[13].label.should.be 'siete'
         end
         it plot8.title.text
             plot8.axes.xaxis.should.have_property '_elem'
             plot1.seriesCanvas.should.have_property '_elem'
             plot8.axes.xaxis.renderer.constructor.should.be $.jqplot.CategoryAxisRenderer
-            plot8.axes.xaxis._ticks[0].label.should.be 'uno'
-            plot8.axes.xaxis._ticks[0].label.should.be 'due'
-            plot8.axes.xaxis._ticks[0].label.should.be 'tre'
-            plot8.axes.xaxis._ticks[0].label.should.be 'quattro'
-            plot8.axes.xaxis._ticks[0].label.should.be 'cinque'
-            plot8.axes.xaxis._ticks[0].label.should.be 'sei'
-            plot8.axes.xaxis._ticks[0].label.should.be 'sette'
+            plot8.axes.xaxis._ticks[1].label.should.be 'uno'
+            plot8.axes.xaxis._ticks[3].label.should.be 'due'
+            plot8.axes.xaxis._ticks[5].label.should.be 'tre'
+            plot8.axes.xaxis._ticks[7].label.should.be 'quattro'
+            plot8.axes.xaxis._ticks[9].label.should.be 'cinque'
+            plot8.axes.xaxis._ticks[11].label.should.be 'sei'
+            plot8.axes.xaxis._ticks[13].label.should.be 'sette'
         end
     end
 
             plot10.axes.xaxis.should.have_property '_elem'
             plot10.seriesCanvas.should.have_property '_elem'
             plot10.axes.xaxis.renderer.constructor.should.be $.jqplot.DateAxisRenderer
-            plot10.axes.xaxis.min.should.be Date.create('May 20, 2008').getTime()
-            plot10.axes.xaxis.tickInterval.should.be [1, 'month']
+            plot10.axes.xaxis.tickInterval.should.be '1 month'
             plot10.axes.xaxis.numberTicks.should.be 7
         end
     end
-0.4.0
+0.4.1