Sha256: 84f33d61cac17007795eb6fb8e5a120d447b376a9f7ef33b4e5a276a36bf801a

Contents?: true

Size: 897 Bytes

Versions: 7

Compression:

Stored size: 897 Bytes

Contents

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

7 entries across 7 versions & 1 rubygems

Version Path
rubocop-rspec-1.32.0 spec/shared/smoke_test_examples.rb
rubocop-rspec-1.31.0 spec/shared/smoke_test_examples.rb
rubocop-rspec-1.30.1 spec/shared/smoke_test_examples.rb
rubocop-rspec-1.30.0 spec/shared/smoke_test_examples.rb
rubocop-rspec-1.29.1 spec/shared/smoke_test_examples.rb
rubocop-rspec-1.29.0 spec/shared/smoke_test_examples.rb
rubocop-rspec-1.28.0 spec/shared/smoke_test_examples.rb