Sha256: d812f2f5928951bfbdeb4bef8893389fcfa4b1b0b1eb6d8b5784072527d55c59
Contents?: true
Size: 661 Bytes
Versions: 7
Compression:
Stored size: 661 Bytes
Contents
RSpec.describe 'Project requires' do it 'alphabetizes cop requires' do source = SpecHelper::ROOT.join('lib', 'rubocop', 'cop', 'rspec_cops.rb') captures = source.read.scan(%r{^(require_relative 'rspec/(.*?/)?(.*?)')$}) require_statements = captures.map(&:first) sorted_require_statements = captures.sort_by do |_require_statement, cop_category, name| [cop_category || 'rspec', name] end.map(&:first) aggregate_failures do # Sanity check that we actually discovered require statements. expect(captures).not_to be_empty expect(require_statements).to eql(sorted_require_statements) end end end
Version data entries
7 entries across 7 versions & 1 rubygems