Sha256: 9f3590e2c5613067bee7d1ab379b5cc1e9319c8a741b1202bf18c6a81b54bcc3

Contents?: true

Size: 1.26 KB

Versions: 48

Compression:

Stored size: 1.26 KB

Contents

require "spec_helper"

describe Mongoid::Extensions::Symbol::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

  describe "#gt" do

    it 'returns :"foo $gt"' do
      ret = :foo.gt
      ret.key.should == :foo
      ret.operator.should == "gt"
    end

  end

end

Version data entries

48 entries across 48 versions & 2 rubygems

Version Path
mongoid-pre-2.0.0.beta1 spec/unit/mongoid/extensions/symbol/inflections_spec.rb
mongoid-2.0.0.alpha spec/unit/mongoid/extensions/symbol/inflections_spec.rb
mongoid-1.2.14 spec/unit/mongoid/extensions/symbol/inflections_spec.rb
mongoid-1.2.13 spec/unit/mongoid/extensions/symbol/inflections_spec.rb
mongoid-1.2.12 spec/unit/mongoid/extensions/symbol/inflections_spec.rb
mongoid-1.2.11 spec/unit/mongoid/extensions/symbol/inflections_spec.rb
mongoid-1.2.10 spec/unit/mongoid/extensions/symbol/inflections_spec.rb
mongoid-1.2.9 spec/unit/mongoid/extensions/symbol/inflections_spec.rb
mongoid-1.2.8 spec/unit/mongoid/extensions/symbol/inflections_spec.rb
mongoid-1.2.7 spec/unit/mongoid/extensions/symbol/inflections_spec.rb
mongoid-pre-2.0.0.pre spec/unit/mongoid/extensions/symbol/inflections_spec.rb
mongoid-1.2.6 spec/unit/mongoid/extensions/symbol/inflections_spec.rb
mongoid-1.2.5 spec/unit/mongoid/extensions/symbol/inflections_spec.rb
mongoid-1.2.4 spec/unit/mongoid/extensions/symbol/inflections_spec.rb
mongoid-1.2.3 spec/unit/mongoid/extensions/symbol/inflections_spec.rb
mongoid-1.2.2 spec/unit/mongoid/extensions/symbol/inflections_spec.rb
mongoid-1.2.1 spec/unit/mongoid/extensions/symbol/inflections_spec.rb
mongoid-1.2.0 spec/unit/mongoid/extensions/symbol/inflections_spec.rb
mongoid-1.1.4 spec/unit/mongoid/extensions/symbol/inflections_spec.rb
mongoid-1.1.3 spec/unit/mongoid/extensions/symbol/inflections_spec.rb