Sha256: 82aa785e040d0330e0f1c3defb754512c1cbd98d65465eb10ae0cc05f5294675

Contents?: true

Size: 576 Bytes

Versions: 6

Compression:

Stored size: 576 Bytes

Contents

require_relative '../../spec_helper'

require_relative '../../../lib/reek/cli/options'

RSpec.describe Reek::CLI::Options do
  describe '#initialize' do
    it 'should enable colors when stdout is a TTY' do
      allow($stdout).to receive_messages(tty?: false)
      options = Reek::CLI::Options.new.parse
      expect(options.colored).to be false
    end

    it 'should not enable colors when stdout is not a TTY' do
      allow($stdout).to receive_messages(tty?: true)
      options = Reek::CLI::Options.new.parse
      expect(options.colored).to be true
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
reek-3.0.3 spec/reek/cli/options_spec.rb
reek-3.0.2 spec/reek/cli/options_spec.rb
reek-3.0.1 spec/reek/cli/options_spec.rb
reek-3.0.0 spec/reek/cli/options_spec.rb
reek-2.2.1 spec/reek/cli/options_spec.rb
reek-2.2.0 spec/reek/cli/options_spec.rb