Sha256: aa8ce4d2ef0225eb53739d157975c6f397d25e81ba16fe390e0aa1f26dddf23e

Contents?: true

Size: 953 Bytes

Versions: 1

Compression:

Stored size: 953 Bytes

Contents

// Copyright 2012 Twitter, Inc
// http://www.apache.org/licenses/LICENSE-2.0

var TwitterCldr = require('../../../lib/assets/javascripts/twitter_cldr/en.js');

describe("Token", function() {
  describe("#constructor", function() {
    it("should set instance variables passed in the options hash", function() {
      token = new TwitterCldr.Token({"type":"my_type", "value":"my_value"});
      expect(token.type).toEqual("my_type");
      expect(token.value).toEqual("my_value");
    });
  });
  describe("#to_string", function() {
    it("should return the token's value", function() {
      expect(new TwitterCldr.Token({"value":"my_value"}).to_string()).toEqual("my_value");
    });
  });
  describe("#to_hash", function() {
    it("should return the token's attributes as a hash", function() {
      properties = {"type":"my_type", "value":"my_value"};
      expect(new TwitterCldr.Token(properties).to_hash()).toEqual(properties);
    });
  });
});

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
twitter_cldr_js-2.4.0 spec/js/tokenizers/token.spec.js