UNPKG

sku-pg

Version:

Skulpt is a Javascript implementation of Python 2.x. Python that runs in your browser!

42 lines (36 loc) 980 B
<!DOCTYPE html> <html> <!-- Copyright 2008 The Closure Library Authors. All Rights Reserved. Use of this source code is governed by an Apache 2.0 License. See the COPYING file for details. --> <!-- Author: marcosalmeida@google.com (Marcos Almeida) --> <head> <title>Closure Unit Tests - goog.testing.MockRange</title> <script src="../base.js"></script> <script> goog.require('goog.testing.MockRange'); goog.require('goog.testing.jsunit'); </script> </head> <body> <script> /** * Tests that a MockRange can be created successfully, a call to a mock * method can be recorded, and the correct behavior replayed and verified. */ function testMockMethod() { var mockRange = new goog.testing.MockRange(); mockRange.getStartOffset().$returns(42); mockRange.$replay(); assertEquals('Mock method should return recorded value', 42, mockRange.getStartOffset()); mockRange.$verify(); } </script> </body> </html>