Sha256: ac3a9fb11c52b9c6512dfa50257496a83ba68c35fa64bda38ff410f175b83206

Contents?: true

Size: 1.64 KB

Versions: 3

Compression:

Stored size: 1.64 KB

Contents

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>JavaScript unit test file</title>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <script src="../../dist/jsunittest.js" type="text/javascript" charset="utf-8"></script>
  <script src="../../src/prototype/template.js" type="text/javascript"></script>
  
  <link rel="stylesheet" href="../assets/unittest.css" type="text/css" />
</head>
<body>

<div id="content">

  <div id="header">
    <h1>JavaScript unit test file</h1>
    <p>
      This file tests <strong>template.js</strong>.
    </p>
  </div>

  <!-- Log output (one per Runner, via {testLog: "testlog"} option)-->
  <div id="testlog"></div>
  
  <!-- Put sample/test html here -->
  <div id="sample"></div>
</div>

<script type="text/javascript">
// <![CDATA[

  new Test.Unit.Runner({
    // Library
    testLibrary: function() { with(this) {
      assert(JsUnitTest.Template);
      assert(new JsUnitTest.Template(""));
    }},

    // Empty string
    testEmptyString: function() { with(this) {
      assertEqual('', new JsUnitTest.Template("").evaluate("asd"));
    }},

    testInterpolate: function() {with(this) {
      var subject = { name: 'Stephan' };
      var pattern = /(^|.|\r|\n)(#\((.*?)\))/;
      assertEqual('#{name}: Stephan', new JsUnitTest.Template('\\#{name}: #{name}').evaluate(subject));
      assertEqual('#(name): Stephan', new JsUnitTest.Template('\\#(name): #(name)', pattern).evaluate(subject));
    }},
    
      
  }); 
// ]]>
</script>
</body>
</html>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
newjs-1.7.0 vendor/jsunittest/test/unit/template_test.html
newjs-1.7.1 vendor/jsunittest/test/unit/template_test.html
newjs-1.7.2 vendor/jsunittest/test/unit/template_test.html