Sha256: f4fde7a90d8528ab1e375c4a01bd2d97b98a92f0bfcb3b91d4acf9d9b12c2355

Contents?: true

Size: 715 Bytes

Versions: 13

Compression:

Stored size: 715 Bytes

Contents

require 'spec_helper'
require 'rainbow/wrapper'

module Rainbow
  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

13 entries across 13 versions & 4 rubygems

Version Path
dirwatch-0.0.9 vendor/bundle/ruby/2.5.0/gems/rainbow-2.2.2/spec/unit/wrapper_spec.rb
dirwatch-0.0.8 vendor/bundle/ruby/2.5.0/gems/rainbow-2.2.2/spec/unit/wrapper_spec.rb
pract6-0.1.0 .gem/ruby/2.3.0/gems/rainbow-2.2.2/spec/unit/wrapper_spec.rb
dirwatch-0.0.6 vendor/bundle/ruby/2.3.0/gems/rainbow-2.2.2/spec/unit/wrapper_spec.rb
dirwatch-0.0.5 vendor/bundle/ruby/2.3.0/gems/rainbow-2.2.2/spec/unit/wrapper_spec.rb
dirwatch-0.0.4 vendor/bundle/ruby/2.3.0/gems/rainbow-2.2.2/spec/unit/wrapper_spec.rb
dirwatch-0.0.3 vendor/bundle/ruby/2.3.0/gems/rainbow-2.2.2/spec/unit/wrapper_spec.rb
dirwatch-0.0.2 vendor/bundle/ruby/2.3.0/gems/rainbow-2.2.2/spec/unit/wrapper_spec.rb
fluent-plugin-detect-memb-exceptions-0.0.2 vendor/bundle/ruby/2.0.0/gems/rainbow-2.2.2/spec/unit/wrapper_spec.rb
fluent-plugin-detect-memb-exceptions-0.0.1 vendor/bundle/ruby/2.0.0/gems/rainbow-2.2.2/spec/unit/wrapper_spec.rb
rainbow-2.2.2 spec/unit/wrapper_spec.rb
rainbow-2.2.1 spec/unit/wrapper_spec.rb
rainbow-2.1.0 spec/unit/wrapper_spec.rb