Sha256: 030143c4b9993bbb25204dfa1776ddefe823c95b4315d055490d206c6f105f9d

Contents?: true

Size: 824 Bytes

Versions: 21

Compression:

Stored size: 824 Bytes

Contents

# frozen_string_literal: true
# encoding: utf-8

require "spec_helper"

describe Mongoid::Extensions::FalseClass do

  describe "#__sortable__" do

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

  describe "#is_a?" do

    context "when provided a Boolean" do

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

    context "when provided a FalseClass" do

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

    context "when provided a TrueClass" do

      it "returns false" do
        expect(false.is_a?(TrueClass)).to be false
      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

21 entries across 21 versions & 2 rubygems

Version Path
mongoid-7.1.11 spec/mongoid/extensions/false_class_spec.rb
mongoid-7.2.6 spec/mongoid/extensions/false_class_spec.rb
mongoid-7.2.5 spec/mongoid/extensions/false_class_spec.rb
mongoid-7.1.10 spec/mongoid/extensions/false_class_spec.rb
mongoid-7.1.9 spec/mongoid/extensions/false_class_spec.rb
mongoid-7.2.4 spec/mongoid/extensions/false_class_spec.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/mongoid-7.1.7/spec/mongoid/extensions/false_class_spec.rb
mongoid-7.2.3 spec/mongoid/extensions/false_class_spec.rb
mongoid-7.1.8 spec/mongoid/extensions/false_class_spec.rb
mongoid-7.2.2 spec/mongoid/extensions/false_class_spec.rb
mongoid-7.2.1 spec/mongoid/extensions/false_class_spec.rb
mongoid-7.1.7 spec/mongoid/extensions/false_class_spec.rb
mongoid-7.2.0 spec/mongoid/extensions/false_class_spec.rb
mongoid-7.1.6 spec/mongoid/extensions/false_class_spec.rb
mongoid-7.1.5 spec/mongoid/extensions/false_class_spec.rb
mongoid-7.2.0.rc1 spec/mongoid/extensions/false_class_spec.rb
mongoid-7.1.4 spec/mongoid/extensions/false_class_spec.rb
mongoid-7.1.2 spec/mongoid/extensions/false_class_spec.rb
mongoid-7.1.1 spec/mongoid/extensions/false_class_spec.rb
mongoid-7.1.0 spec/mongoid/extensions/false_class_spec.rb