Sha256: 4960921582e55a918d95ef6a61a10b945aa0338a3fc237599e706ae78b40d879

Contents?: true

Size: 770 Bytes

Versions: 69

Compression:

Stored size: 770 Bytes

Contents

require "spec_helper"

describe Mongoid::Extensions::TrueClass do

  describe "#__sortable__" do

    it "returns 1" do
      expect(true.__sortable__).to eq(1)
    end
  end

  describe "#is_a?" do

    context "when provided a Boolean" do

      it "returns true" do
        expect(true.is_a?(Boolean)).to be true
      end
    end

    context "when provided a FalseClass" do

      it "returns false" do
        expect(true.is_a?(FalseClass)).to be false
      end
    end

    context "when provided a TrueClass" do

      it "returns true" do
        expect(true.is_a?(TrueClass)).to be true
      end
    end

    context "when provided an invalid class" do

      it "returns false" do
        expect(false.is_a?(String)).to be false
      end
    end
  end
end

Version data entries

69 entries across 64 versions & 3 rubygems

Version Path
tdiary-5.0.8 vendor/bundle/gems/mongoid-6.4.0/spec/mongoid/extensions/true_class_spec.rb
mongoid-7.0.0 spec/mongoid/extensions/true_class_spec.rb
mongoid-6.4.0 spec/mongoid/extensions/true_class_spec.rb
mongoid-6.3.0 spec/mongoid/extensions/true_class_spec.rb
mongoid-6.2.1 spec/mongoid/extensions/true_class_spec.rb
mongoid-7.0.0.beta spec/mongoid/extensions/true_class_spec.rb
tdiary-5.0.5 vendor/bundle/gems/mongoid-6.2.0/spec/mongoid/extensions/true_class_spec.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/mongoid-6.1.0/spec/mongoid/extensions/true_class_spec.rb
tdiary-5.0.5 vendor/bundle/gems/mongoid-6.1.0/spec/mongoid/extensions/true_class_spec.rb
mongoid-6.2.0 spec/mongoid/extensions/true_class_spec.rb
mongoid-6.1.1 spec/mongoid/extensions/true_class_spec.rb
mongoid-5.2.1 spec/mongoid/extensions/true_class_spec.rb
tdiary-5.0.4 vendor/bundle/gems/mongoid-6.1.0/spec/mongoid/extensions/true_class_spec.rb
mongoid-6.1.0 spec/mongoid/extensions/true_class_spec.rb
mongoid-5.2.0 spec/mongoid/extensions/true_class_spec.rb
mongoid-5.2.0.rc0 spec/mongoid/extensions/true_class_spec.rb
mongoid-6.1.0.rc0 spec/mongoid/extensions/true_class_spec.rb
mongoid-6.0.3 spec/mongoid/extensions/true_class_spec.rb
mongoid-5.1.6 spec/mongoid/extensions/true_class_spec.rb
mongoid-6.0.2 spec/mongoid/extensions/true_class_spec.rb