Sha256: 1e268cbe1869691c790eaa6dc5dc59fbfbd0d756bc4b486ca963f6af6126ba0d

Contents?: true

Size: 1.12 KB

Versions: 12

Compression:

Stored size: 1.12 KB

Contents

require "spec_helper"

describe Mongoid::Extensions::String::Inflections do

  describe "#singular?" do

    context "when singular" do

      it "returns true" do
        "bat".singular?.should be_true
      end

    end

    context "when plural" do

      it "returns false" do
        "bats".singular?.should be_false
      end

    end

  end

  describe "plural?" do

    context "when singular" do

      it "returns false" do
        "bat".plural?.should be_false
      end

    end

    context "when plural" do

      it "returns true" do
        "bats".plural?.should be_true
      end

    end

  end

  describe "invert" do

    context "when asc" do

      it "returns desc" do
        "asc".invert.should == "desc"
      end

    end

    context "when ascending" do

      it "returns descending" do
        "ascending".invert.should == "descending"
      end

    end

    context "when desc" do

      it "returns asc" do
        "desc".invert.should == "asc"
      end

    end

    context "when descending" do

      it "returns ascending" do
        "descending".invert.should == "ascending"
      end

    end

  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
mongoid-0.10.1 spec/unit/mongoid/extensions/string/inflections_spec.rb
mongoid-0.10.0 spec/unit/mongoid/extensions/string/inflections_spec.rb
mongoid-0.9.12 spec/unit/mongoid/extensions/string/inflections_spec.rb
mongoid-0.9.11 spec/unit/mongoid/extensions/string/inflections_spec.rb
mongoid-0.9.10 spec/unit/mongoid/extensions/string/inflections_spec.rb
mongoid-0.9.9 spec/unit/mongoid/extensions/string/inflections_spec.rb
mongoid-0.9.8 spec/unit/mongoid/extensions/string/inflections_spec.rb
mongoid-0.9.7 spec/unit/mongoid/extensions/string/inflections_spec.rb
mongoid-0.9.6 spec/unit/mongoid/extensions/string/inflections_spec.rb
mongoid-0.9.5 spec/unit/mongoid/extensions/string/inflections_spec.rb
mongoid-0.9.4 spec/unit/mongoid/extensions/string/inflections_spec.rb
mongoid-0.9.3 spec/unit/mongoid/extensions/string/inflections_spec.rb