Skip to content

Commit

Permalink
Auto-correct RSpec/HookArgument to remove redundant defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
atz committed Apr 10, 2018
1 parent 95f67c6 commit 579f64c
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 17 deletions.
6 changes: 0 additions & 6 deletions .rubocop_todo.yml
Expand Up @@ -131,12 +131,6 @@ RSpec/EmptyLineAfterFinalLet:
RSpec/ExampleLength:
Enabled: false

# Offense count: 11
# Configuration parameters: SupportedStyles.
# SupportedStyles: implicit, each, example
RSpec/HookArgument:
EnforcedStyle: each

# Offense count: 465
# Configuration parameters: AssignmentOnly.
RSpec/InstanceVariable:
Expand Down
2 changes: 1 addition & 1 deletion spec/unit_tests/moab/bagger_spec.rb
Expand Up @@ -35,7 +35,7 @@
@disseminate_bag_pathname = @temp.join('disseminate_bag_pathname')
end

before(:each) do
before do
@submit_bag_pathname.rmtree if @submit_bag_pathname.exist?
@submit_bag_pathname.mkpath

Expand Down
2 changes: 1 addition & 1 deletion spec/unit_tests/moab/deposit_bag_validator_spec.rb
Expand Up @@ -83,7 +83,7 @@
end

describe 'when unrecognized checksum, result array has CHECKSUM_TYPE_UNRECOGNIZED result hash' do
before(:each) do
before do
bag_pathname = Pathname(File.join(deposit_dir_pathname, 'unknown-checksum-alg'))
@storage_obj = instance_double(Moab::StorageObject, deposit_bag_pathname: bag_pathname, current_version_id: 0)
end
Expand Down
4 changes: 2 additions & 2 deletions spec/unit_tests/moab/file_group_spec.rb
Expand Up @@ -44,7 +44,7 @@ def basic_expectations(file_group)
end

describe 'INSTANCE METHODS' do
before(:each) do
before do
@v1_file_group = described_class.new.group_from_directory(@fixtures.join('data/jq937jp0017/v0001/content'), true)
@new_file_group = described_class.new
end
Expand Down Expand Up @@ -85,7 +85,7 @@ def basic_expectations(file_group)

context "#is_descendent_of_base?" do
# FIXME: shouldn't this method be named descendent_of_base?
before(:each) { @new_file_group.base_directory = @fixtures.join('data') }
before { @new_file_group.base_directory = @fixtures.join('data') }
it "true when condition met" do
expect(@new_file_group).to be_is_descendent_of_base(@fixtures.join('data/jq937jp0017/v0001'))
end
Expand Down
2 changes: 1 addition & 1 deletion spec/unit_tests/moab/signature_catalog_spec.rb
Expand Up @@ -24,7 +24,7 @@
@v2_inventory_pathname = @fixtures.join('derivatives/ingests/jq937jp0017/v0002/manifests/versionInventory.xml')
@v2_inventory = Moab::FileInventory.parse(@v2_inventory_pathname.read)
end
before(:each) do
before do
@signature_catalog = described_class.parse(@v1_catalog_pathname.read)
@original_entry_count = @signature_catalog.entries.count
end
Expand Down
6 changes: 3 additions & 3 deletions spec/unit_tests/moab/storage_object_spec.rb
Expand Up @@ -28,7 +28,7 @@
expect(storage_object.object_pathname.to_s).to include('temp/ingests/jq937jp0017')
end

before(:each) do
before do
@storage_object = described_class.new(@druid, @temp_object_dir)
@storage_object.initialize_storage
@storage_object.storage_root = @fixtures.join('derivatives')
Expand Down Expand Up @@ -398,7 +398,7 @@
end

context '#find_object_version' do
before(:each) { @storage_object = described_class.new(@druid, @ingest_object_dir) }
before { @storage_object = described_class.new(@druid, @ingest_object_dir) }
it 'existing version' do
version_2 = @storage_object.find_object_version(2)
expect(version_2).to be_instance_of(Moab::StorageObjectVersion)
Expand All @@ -420,7 +420,7 @@
end

context '#storage_object_version' do
before(:each) { @storage_object = described_class.new(@druid, @ingest_object_dir) }
before { @storage_object = described_class.new(@druid, @ingest_object_dir) }
it 'existing version' do
version_2 = @storage_object.storage_object_version(2)
expect(version_2).to be_instance_of(Moab::StorageObjectVersion)
Expand Down
2 changes: 1 addition & 1 deletion spec/unit_tests/moab/storage_object_version_spec.rb
Expand Up @@ -39,7 +39,7 @@
end
end

before(:each) do
before do
@temp_object_dir.rmtree if @temp_object_dir.exist?
end

Expand Down
2 changes: 1 addition & 1 deletion spec/unit_tests/moab/storage_repository_spec.rb
Expand Up @@ -47,7 +47,7 @@
end

context '#storage_object' do
before(:each) do
before do
mock_storage_obj = double(Moab::StorageObject)
allow(storage_repo).to receive(:find_storage_object).and_return(mock_storage_obj)
@mock_path = double(Pathname)
Expand Down
2 changes: 1 addition & 1 deletion spec/unit_tests/stanford/content_inventory_spec.rb
Expand Up @@ -14,7 +14,7 @@
@node = Nokogiri::XML(@content_metadata).xpath('//file').first
end

before(:each) { @content_inventory = described_class.new() }
before { @content_inventory = described_class.new() }

context '#inventory_from_cm' do
it 'version_id = 2' do
Expand Down

0 comments on commit 579f64c

Please sign in to comment.