Sha256: 65f375eb8b25f4c2470cb28beae9138050c4a8a77c37adfdf24e37ba43f7246d

Contents?: true

Size: 776 Bytes

Versions: 1

Compression:

Stored size: 776 Bytes

Contents

describe Spree::Inflector do
  describe ".pluralize" do
    describe "defined Inflection" do
      it "adds an s to the end of the specified singular" do
        Spree::Inflector.pluralize("cat").should == "cats"
      end

      it "pluralizes country" do
        Spree::Inflector.pluralize("country").should == "countries"
      end
    end

    describe "undefined Inflection" do
      it "raises Spree::Inflector::UndefinedInflection" do
        lambda {
          Spree::Inflector.pluralize("42")
        }.should.raise(Spree::Inflector::UndefinedInflection)
      end
    end
  end

  describe ".inflections" do
    it "defines a new inflection" do
      Spree::Inflector.inflection 'foo', 'bar'
      Spree::Inflector.pluralize('foo').should == 'bar'
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
spree-wrap-0.0.2 spec/spree/inflector_spec.rb