Sha256: bda0ef508a32294ce32efd732780bbea3d9d5824cb58573d779848dcc52a24e6

Contents?: true

Size: 719 Bytes

Versions: 97

Compression:

Stored size: 719 Bytes

Contents

require 'spec_helper'
require 'rainbow/wrapper'

module Rainbow
  RSpec.describe Wrapper do
    let(:wrapper) { described_class.new(enabled) }

    it "is enabled by default" do
      expect(described_class.new.enabled).to be(true)
    end

    describe '#wrap' do
      subject { wrapper.wrap(object) }

      let(:object) { Object.new }

      context "when wrapping is enabled" do
        let(:enabled) { true }

        it { should eq(object.to_s) }
        it { should be_kind_of(Rainbow::Presenter) }
      end

      context "when wrapping is disabled" do
        let(:enabled) { false }

        it { should eq(object.to_s) }
        it { should be_kind_of(Rainbow::NullPresenter) }
      end
    end
  end
end

Version data entries

97 entries across 90 versions & 19 rubygems

Version Path
primary_connect_proto-0.20.0 vendor/bundle/ruby/2.6.0/gems/rainbow-3.0.0/spec/unit/wrapper_spec.rb
primary_connect_proto-0.20.0 vendor/bundle/ruby/3.0.0/gems/rainbow-3.0.0/spec/unit/wrapper_spec.rb
primary_connect_proto-0.19.0 vendor/bundle/ruby/3.0.0/gems/rainbow-3.0.0/spec/unit/wrapper_spec.rb
primary_connect_proto-0.18.0 vendor/bundle/ruby/2.6.0/gems/rainbow-3.0.0/spec/unit/wrapper_spec.rb
primary_connect_proto-0.18.0 vendor/bundle/ruby/3.0.0/gems/rainbow-3.0.0/spec/unit/wrapper_spec.rb
primary_connect_proto-0.17.0 vendor/bundle/ruby/2.6.0/gems/rainbow-3.0.0/spec/unit/wrapper_spec.rb
primary_connect_proto-0.17.0 vendor/bundle/ruby/3.0.0/gems/rainbow-3.0.0/spec/unit/wrapper_spec.rb
primary_connect_proto-0.12.1 vendor/bundle/ruby/2.7.0/gems/rainbow-3.0.0/spec/unit/wrapper_spec.rb
primary_connect_proto-0.10.2 vendor/bundle/ruby/2.7.0/gems/rainbow-3.0.0/spec/unit/wrapper_spec.rb
primary_connect_proto-0.10.1 vendor/bundle/ruby/2.7.0/gems/rainbow-3.0.0/spec/unit/wrapper_spec.rb
primary_connect_proto-0.9.0 vendor/bundle/ruby/2.6.0/gems/rainbow-3.0.0/spec/unit/wrapper_spec.rb
primary_connect_proto-0.8.2 vendor/bundle/ruby/2.7.0/gems/rainbow-3.0.0/spec/unit/wrapper_spec.rb
primary_connect_proto-0.8.1 vendor/bundle/ruby/2.7.0/gems/rainbow-3.0.0/spec/unit/wrapper_spec.rb
primary_connect_proto-0.8.0 vendor/bundle/ruby/2.6.0/gems/rainbow-3.0.0/spec/unit/wrapper_spec.rb
primary_connect_proto-0.7.3 vendor/bundle/ruby/2.6.0/gems/rainbow-3.0.0/spec/unit/wrapper_spec.rb
primary_connect_proto-0.7.2 vendor/bundle/ruby/2.6.0/gems/rainbow-3.0.0/spec/unit/wrapper_spec.rb
primary_connect_proto-0.7.1 vendor/bundle/ruby/2.6.0/gems/rainbow-3.0.0/spec/unit/wrapper_spec.rb
primary_connect_proto-0.7.0 vendor/bundle/ruby/2.6.0/gems/rainbow-3.0.0/spec/unit/wrapper_spec.rb
primary_connect_proto-0.6.0 vendor/bundle/ruby/2.6.0/gems/rainbow-3.0.0/spec/unit/wrapper_spec.rb
plaid-14.13.0 vendor/bundle/ruby/3.0.0/gems/rainbow-3.0.0/spec/unit/wrapper_spec.rb