Sha256: 9927112d62ccac6b9082ed9a23a90e85df2390d57fc2fdbd36976b5f7eaec58e

Contents?: true

Size: 755 Bytes

Versions: 3

Compression:

Stored size: 755 Bytes

Contents

require "spec_helper"

describe Mongoid::Extensions::FalseClass do

  describe "#__sortable__" do

    it "returns 0" do
      false.__sortable__.should eq(0)
    end
  end

  describe "#is_a?" do

    context "when provided a Boolean" do

      it "returns true" do
        false.is_a?(Boolean).should be_true
      end
    end

    context "when provided a FalseClass" do

      it "returns true" do
        false.is_a?(FalseClass).should be_true
      end
    end

    context "when provided a TrueClass" do

      it "returns false" do
        false.is_a?(TrueClass).should be_false
      end
    end

    context "when provided an invalid class" do

      it "returns false" do
        false.is_a?(String).should be_false
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mongoid-3.1.7 spec/mongoid/extensions/false_class_spec.rb
mongoid-3.1.6 spec/mongoid/extensions/false_class_spec.rb
mongoid-3.1.5 spec/mongoid/extensions/false_class_spec.rb