Sha256: 4609bf33566053403399f760a6a3483a67dc3564c0c9f2841efd5d0eadf47d32

Contents?: true

Size: 822 Bytes

Versions: 1

Compression:

Stored size: 822 Bytes

Contents

require 'spec_helper'

RSpec.describe PolishGeeks::DevTools::Validators::Rubocop do
  subject { described_class.new(double) }

  describe '#valid?' do
    context 'false' do
      context 'when Rubocop is enabled' do
        before do
          expect(PolishGeeks::DevTools::Config).to receive(:config).and_return(
            instance_double(PolishGeeks::DevTools::Config, rubocop: false)
          )
        end
        it { expect(subject.valid?).to be false }
      end
    end

    context 'true' do
      context 'when Rubocop is disabled' do
        before do
          expect(PolishGeeks::DevTools::Config).to receive(:config).and_return(
            instance_double(PolishGeeks::DevTools::Config, rubocop: true)
          )
        end
        it { expect(subject.valid?).to be true }
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
polishgeeks-dev-tools-1.3.2 spec/lib/polish_geeks/dev_tools/validators/rubocop_spec.rb