Sha256: 55c8a094a0654b2c85204dc7041e4da8bd91ab0536a874cc4193126e0488764f

Contents?: true

Size: 725 Bytes

Versions: 14

Compression:

Stored size: 725 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

describe Object do
  describe '#is_any?' do
    subject(:object) { 1 }

    it do
      expect(object).to respond_to(:is_any?)
    end

    context 'when no argument is passed' do
      it do
        expect(object).not_to be_is_any
      end
    end

    context 'when passing the correct class as argument' do
      it do
        expect(object).to be_is_any(object.class)
      end

      context 'when passing any other class' do
        it do
          expect(object).to be_is_any(Symbol, object.class)
        end
      end
    end

    context 'when passing the wrong class' do
      it do
        expect(object).not_to be_is_any(Symbol)
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
sinclair-2.1.1 spec/lib/sinclair/core_ext/object_spec.rb
sinclair-2.1.0 spec/lib/sinclair/core_ext/object_spec.rb
sinclair-2.0.1 spec/lib/sinclair/core_ext/object_spec.rb
sinclair-2.0.0 spec/lib/sinclair/core_ext/object_spec.rb
sinclair-1.16.3 spec/lib/sinclair/core_ext/object_spec.rb
sinclair-1.16.2 spec/lib/sinclair/core_ext/object_spec.rb
sinclair-1.16.1 spec/lib/sinclair/core_ext/object_spec.rb
sinclair-1.16.0 spec/lib/sinclair/core_ext/object_spec.rb
sinclair-1.15.0 spec/lib/sinclair/core_ext/object_spec.rb
sinclair-1.14.2 spec/lib/sinclair/core_ext/object_spec.rb
sinclair-1.14.1 spec/lib/sinclair/core_ext/object_spec.rb
sinclair-1.14.0 spec/lib/sinclair/core_ext/object_spec.rb
sinclair-1.13.0 spec/lib/sinclair/core_ext/object_spec.rb
darthjee-core_ext-1.7.4 spec/lib/object_spec.rb