Sha256: 67c4355f4c43067cfdff447c3035bb464425ba674d7e35c0c6b8e7fd8cbbcd3e

Contents?: true

Size: 810 Bytes

Versions: 27

Compression:

Stored size: 810 Bytes

Contents

# frozen_string_literal: true

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?(Mongoid::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

27 entries across 27 versions & 1 rubygems

Version Path
mongoid-8.1.9 spec/mongoid/extensions/true_class_spec.rb
mongoid-8.0.9 spec/mongoid/extensions/true_class_spec.rb
mongoid-8.1.8 spec/mongoid/extensions/true_class_spec.rb
mongoid-8.1.7 spec/mongoid/extensions/true_class_spec.rb
mongoid-8.1.6 spec/mongoid/extensions/true_class_spec.rb
mongoid-8.0.8 spec/mongoid/extensions/true_class_spec.rb
mongoid-8.1.5 spec/mongoid/extensions/true_class_spec.rb
mongoid-8.1.4 spec/mongoid/extensions/true_class_spec.rb
mongoid-8.0.7 spec/mongoid/extensions/true_class_spec.rb
mongoid-8.1.3 spec/mongoid/extensions/true_class_spec.rb
mongoid-8.1.2 spec/mongoid/extensions/true_class_spec.rb
mongoid-8.0.6 spec/mongoid/extensions/true_class_spec.rb
mongoid-7.5.4 spec/mongoid/extensions/true_class_spec.rb
mongoid-8.1.1 spec/mongoid/extensions/true_class_spec.rb
mongoid-8.0.5 spec/mongoid/extensions/true_class_spec.rb
mongoid-8.1.0 spec/mongoid/extensions/true_class_spec.rb
mongoid-7.5.3 spec/mongoid/extensions/true_class_spec.rb
mongoid-8.0.4 spec/mongoid/extensions/true_class_spec.rb
mongoid-8.0.3 spec/mongoid/extensions/true_class_spec.rb
mongoid-7.5.2 spec/mongoid/extensions/true_class_spec.rb