Sha256: d86563c03fe0ca017648e318365427499223dbb2cba393d7a070a89cb2bc242d

Contents?: true

Size: 885 Bytes

Versions: 9

Compression:

Stored size: 885 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("PluralRules", function() {
  describe("#all", function() {
    it("returns an array of all English plural rules", function() {
      expect(TwitterCldr.PluralRules.all()).toEqual(["one", "other"]);
    });
  });

  describe("#rule_for", function() {
    it("returns 'one' for the number 1", function() {
      expect(TwitterCldr.PluralRules.rule_for(1)).toEqual("one");
    });

    it("returns 'other' for any number greater than 1", function() {
      for (var i = 2; i < 10; i ++) {
        expect(TwitterCldr.PluralRules.rule_for(i)).toEqual("other");
      }
    });

    it("returns 'other' for the number 0", function() {
      expect(TwitterCldr.PluralRules.rule_for(0)).toEqual("other");
    });
  });
});

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
twitter_cldr_js-2.3.2 spec/js/plurals/plural_rules.spec.js
twitter_cldr_js-2.3.1 spec/js/plurals/plural_rules.spec.js
twitter_cldr_js-2.3.0 spec/js/plurals/plural_rules.spec.js
twitter_cldr_js-2.2.4 spec/js/plurals/plural_rules.spec.js
twitter_cldr_js-2.2.3 spec/js/plurals/plural_rules.spec.js
twitter_cldr_js-2.2.2 spec/js/plurals/plural_rules.spec.js
twitter_cldr_js-2.2.0 spec/js/plurals/plural_rules.spec.js
twitter_cldr_js-2.1.0 spec/js/plurals/plural_rules.spec.js
twitter_cldr_js-2.0.0 spec/js/plurals/plural_rules.spec.js