Sha256: 6612d437662308c2e41b11f1b836a4b4ab8b24798ebeb12ec59ef469d4a6c5b1

Contents?: true

Size: 928 Bytes

Versions: 4

Compression:

Stored size: 928 Bytes

Contents

# frozen_string_literal: true

RSpec.shared_examples 'smoke test', type: :cop_spec do
  context 'with default configuration' do
    # This is overridden to avoid a number of specs that define `cop_config`
    # (so it is referenced in the 'config' shared context) but do not define
    # all of the dependent configuration options until inside of a context
    # that is out of scope, causing a NameError.
    let(:cop_config) { {} }

    stress_tests = Pathname.glob('spec/smoke_tests/*.rb')

    raise 'No smoke tests could be found!' if stress_tests.empty?

    stress_tests.each do |path|
      it "does not crash on smoke test: #{path}" do
        source    = path.read
        file_name = path.to_s

        aggregate_failures do
          expect { inspect_source(source, file_name) }.not_to raise_error
          expect { autocorrect_source(source, file_name) }.not_to raise_error
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rubocop-rspec-1.35.0 spec/shared/smoke_test_examples.rb
rubocop-rspec-1.34.1 spec/shared/smoke_test_examples.rb
rubocop-rspec-1.34.0 spec/shared/smoke_test_examples.rb
rubocop-rspec-1.33.0 spec/shared/smoke_test_examples.rb