Skip to content

Commit

Permalink
rspec-cleanup (#274)
Browse files Browse the repository at this point in the history
no need to require spec helper explicitly when it's in .rspec  🎯
  • Loading branch information
dpep authored Mar 9, 2024
1 parent 2f264ca commit 77a9ac5
Show file tree
Hide file tree
Showing 49 changed files with 1 addition and 96 deletions.
1 change: 1 addition & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--require spec_helper
2 changes: 0 additions & 2 deletions spec/features/binary/binary_file_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

fixture_path = 'spec/fixtures'

# this reads a binary database dump file, which is in structure like a CSV file
Expand Down
2 changes: 0 additions & 2 deletions spec/features/chunked/chunked_reading_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

fixture_path = 'spec/fixtures'

describe 'chunked reading' do
Expand Down
2 changes: 0 additions & 2 deletions spec/features/chunked/chunked_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

fixture_path = 'spec/fixtures'

class Processor
Expand Down
2 changes: 0 additions & 2 deletions spec/features/converters/convert_values_to_numeric_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

fixture_path = 'spec/fixtures'

describe 'numeric conversion of values' do
Expand Down
2 changes: 0 additions & 2 deletions spec/features/converters/value_converters_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

fixture_path = 'spec/fixtures'

require 'date'
Expand Down
2 changes: 0 additions & 2 deletions spec/features/formating/bom_issues_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

fixture_path = 'spec/fixtures'

describe 'BOM Tests' do
Expand Down
2 changes: 0 additions & 2 deletions spec/features/formating/carriage_return_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

fixture_path = 'spec/fixtures'

describe 'process files with line endings explicitly pre-specified' do
Expand Down
2 changes: 0 additions & 2 deletions spec/features/formating/column_separator_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

fixture_path = 'spec/fixtures'

describe 'can handle col_sep' do
Expand Down
2 changes: 0 additions & 2 deletions spec/features/formating/emoji_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

fixture_path = 'spec/fixtures'

[true, false].each do |bool|
Expand Down
2 changes: 0 additions & 2 deletions spec/features/formating/line_ending_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

fixture_path = 'spec/fixtures'

describe 'process files with line endings explicitly pre-specified' do
Expand Down
2 changes: 0 additions & 2 deletions spec/features/formating/valid_unicode_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

fixture_path = 'spec/fixtures'

describe 'valid unicode' do
Expand Down
2 changes: 0 additions & 2 deletions spec/features/general/additional_separator_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

fixture_path = 'spec/fixtures'

describe 'handling of additional trailing column separators' do
Expand Down
2 changes: 0 additions & 2 deletions spec/features/general/basic_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

fixture_path = 'spec/fixtures'

[true, false].each do |bool|
Expand Down
2 changes: 0 additions & 2 deletions spec/features/general/empty_columns_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

fixture_path = 'spec/fixtures'

describe 'can handle empty columns' do
Expand Down
2 changes: 0 additions & 2 deletions spec/features/general/simple_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

fixture_path = 'spec/fixtures'

describe 'handling files with one column' do
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

fixture_path = 'spec/fixtures'

describe ':remove_empty_values option' do
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

fixture_path = 'spec/fixtures'

describe ':remove_zero_values option' do
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

fixture_path = 'spec/fixtures'

describe ':remove_unmapped_keys option' do
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

fixture_path = 'spec/fixtures'

describe ':remove_values_matching option' do
Expand Down
2 changes: 0 additions & 2 deletions spec/features/hash_transformations/remove_zero_values_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

fixture_path = 'spec/fixtures'

describe ':remove_zero_values option' do
Expand Down
2 changes: 0 additions & 2 deletions spec/features/header_handling/duplicate_headers_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

fixture_path = 'spec/fixtures'

describe 'duplicate headers' do
Expand Down
2 changes: 0 additions & 2 deletions spec/features/header_handling/header_transformation_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

fixture_path = 'spec/fixtures'

describe 'header transformations option' do
Expand Down
2 changes: 0 additions & 2 deletions spec/features/header_handling/invalid_headers_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

fixture_path = 'spec/fixtures'

#
Expand Down
2 changes: 0 additions & 2 deletions spec/features/header_handling/keep_headers_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

fixture_path = 'spec/fixtures'

describe ':keep_original_headers option' do
Expand Down
2 changes: 0 additions & 2 deletions spec/features/header_handling/key_mapping_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

fixture_path = 'spec/fixtures'

describe 'key_mapping' do
Expand Down
2 changes: 0 additions & 2 deletions spec/features/header_handling/no_header_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

fixture_path = 'spec/fixtures'

describe 'no header in file' do
Expand Down
2 changes: 0 additions & 2 deletions spec/features/header_handling/not_downcase_header_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

fixture_path = 'spec/fixtures'

describe ':downcase_header option' do
Expand Down
2 changes: 0 additions & 2 deletions spec/features/header_handling/required_headers_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

fixture_path = 'spec/fixtures'

describe 'required_headers -> required_keys' do
Expand Down
2 changes: 0 additions & 2 deletions spec/features/header_handling/silence_missing_keys_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

fixture_path = 'spec/fixtures'

describe 'silence missing keys' do
Expand Down
2 changes: 0 additions & 2 deletions spec/features/header_handling/strings_as_keys_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

fixture_path = 'spec/fixtures'

describe ':strings_as_keys option' do
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

fixture_path = 'spec/fixtures'

describe ':strip_chars_from_headers option' do
Expand Down
2 changes: 0 additions & 2 deletions spec/features/ignore_comments_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

fixture_path = 'spec/fixtures'

describe ':comment_regexp option' do
Expand Down
2 changes: 0 additions & 2 deletions spec/features/quotes/escaped_quote_chars_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

fixture_path = 'spec/fixtures'

[true, false].each do |bool|
Expand Down
2 changes: 0 additions & 2 deletions spec/features/quotes/quoted_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

fixture_path = 'spec/fixtures'

describe 'loading file with quoted fields' do
Expand Down
2 changes: 0 additions & 2 deletions spec/features/skip_lines_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

fixture_path = 'spec/fixtures'

describe ':skip_lines option' do
Expand Down
2 changes: 0 additions & 2 deletions spec/features/special_cases/hard_sample_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

fixture_path = 'spec/fixtures'

describe 'can handle the difficult CSV file' do
Expand Down
2 changes: 0 additions & 2 deletions spec/features/special_cases/malformed_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

fixture_path = 'spec/fixtures'

# according to RFC-4180 quotes inside of "words" shouldbe doubled, but our parser is robust against that.
Expand Down
2 changes: 0 additions & 2 deletions spec/features/special_cases/problematic_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

fixture_path = 'spec/fixtures'

describe 'loading file with UTF-8 characters in the header' do
Expand Down
2 changes: 0 additions & 2 deletions spec/features/special_cases/trading_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

fixture_path = 'spec/fixtures'

# somebody reported that a column called 'options_trader' would be truncated to 'trader'
Expand Down
2 changes: 0 additions & 2 deletions spec/smarter_csv/blank_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

describe 'blank?' do
it 'is true for nil' do
expect(SmarterCSV.send(:blank?, nil)).to eq true
Expand Down
2 changes: 0 additions & 2 deletions spec/smarter_csv/close_file_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

fixture_path = 'spec/fixtures'

describe 'file operations' do
Expand Down
2 changes: 0 additions & 2 deletions spec/smarter_csv/file_encoding_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe SmarterCSV do
describe 'encoding warning message' do
let(:file_path) { 'path/to/csvfile.csv' }
Expand Down
2 changes: 0 additions & 2 deletions spec/smarter_csv/option_validations_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

fixture_path = 'spec/fixtures'

describe 'option validations' do
Expand Down
2 changes: 0 additions & 2 deletions spec/smarter_csv/options_processing_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

describe 'options processing' do
describe '#process_options' do
it 'prints out given options in verbose mode' do
Expand Down
2 changes: 0 additions & 2 deletions spec/smarter_csv/parse/column_separator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# code paths are behaving identically.
# ------------------------------------------------------------------------------------------

require 'spec_helper'

[true, false].each do |bool|
describe "fulfills RFC-4180 and more with#{bool ? ' C-' : 'out '}acceleration" do
describe 'parse with col_sep' do
Expand Down
2 changes: 0 additions & 2 deletions spec/smarter_csv/parse/max_size_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# code paths are behaving identically.
# ------------------------------------------------------------------------------------------

require 'spec_helper'

# the purpose of the max_size parameter is to handle a corner case where
# CSV lines contain more fields than the header.
# In which case the remaining fields in the line are ignored
Expand Down
2 changes: 0 additions & 2 deletions spec/smarter_csv/parse/old_csv_library_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# code paths are behaving identically.
# ------------------------------------------------------------------------------------------

require 'spec_helper'

[true, false].each do |bool|
describe "fulfills RFC-4180 and more with#{bool ? ' C-' : 'out '}acceleration" do
describe 'old CSV library parsing tests' do
Expand Down
2 changes: 0 additions & 2 deletions spec/smarter_csv/parse/rfc4180_and_more_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# code paths are behaving identically.
# ------------------------------------------------------------------------------------------

require 'spec_helper'

[true, false].each do |bool|
describe "fulfills RFC-4180 and more with#{bool ? ' C-' : 'out '}acceleration" do
let(:options) { {col_sep: ',', row_sep: $INPUT_RECORD_SEPARATOR, quote_char: '"', acceleration: bool } }
Expand Down

0 comments on commit 77a9ac5

Please sign in to comment.