Sha256: c772fb3fc713c328b55bd52ec77199148bc9d896e424e4eeba48c42492c7e659

Contents?: true

Size: 770 Bytes

Versions: 4

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

4 entries across 4 versions & 3 rubygems

Version Path
sepastian-mongoid-rails4-4.0.1.alpha spec/mongoid/extensions/true_class_spec.rb
sepastian-mongoid-rails4-4.0.0.alpha spec/mongoid/extensions/true_class_spec.rb
mongoid_heroku_stable-4.0.0 spec/mongoid/extensions/true_class_spec.rb
mongoid_rails4-4.0.0 spec/mongoid/extensions/true_class_spec.rb