ServiceInnovationLab/serviceinnovationlab.github.io

View on GitHub
spec/_plugins/author_data_spec.rb

Summary

Maintainability
B
6 hrs
Test Coverage

Showing 12 of 12 total issues

Block has too many lines. [173/25]
Open

RSpec.describe SiteData::AuthorData do
before do
root = File.dirname(File.dirname(__FILE__))
 
@author_data = described_class.new(root)
Severity: Minor
Found in spec/_plugins/author_data_spec.rb by rubocop

Block has too many lines. [67/25]
Open

context 'with YAML frontmatter -- ' do
it 'confirms that a exists' do
exists = @author_data.exists? 'author'
expect(exists).to eq true
end
Severity: Minor
Found in spec/_plugins/author_data_spec.rb by rubocop

Block has too many lines. [55/25]
Open

context 'given a file with content and YAML frontmatter' do
it 'confirms that a exists' do
exists = @author_data.exists? 'author_with_content'
expect(exists).to eq true
end
Severity: Minor
Found in spec/_plugins/author_data_spec.rb by rubocop

Block has too many lines. [38/25]
Open

describe 'class variables' do
it "generates a list of 'published_authors'" do
expect(@published_authors).to be_kind_of(Array)
expect(@published_authors).not_to be_empty
expect(@published_authors.size).to be > 0
Severity: Minor
Found in spec/_plugins/author_data_spec.rb by rubocop

Similar blocks of code found in 2 locations. Consider refactoring.
Open

it 'can update and leave the content intact' do
author_name = @author_data.fetch('author_with_content', 'name')
expect(author_name).to eq 'burt'
 
file_path = @author_data.create_file_path('author_with_content')
Severity: Major
Found in spec/_plugins/author_data_spec.rb and 1 other location - About 1 hr to fix
spec/_plugins/author_data_spec.rb on lines 86..98

Similar blocks of code found in 2 locations. Consider refactoring.
Open

it 'can update and leave the content intact' do
author_name = @author_data.fetch('author', 'name')
expect(author_name).to eq 'aaron'
 
file_path = @author_data.create_file_path('author')
Severity: Major
Found in spec/_plugins/author_data_spec.rb and 1 other location - About 1 hr to fix
spec/_plugins/author_data_spec.rb on lines 149..161

Similar blocks of code found in 4 locations. Consider refactoring.
Open

it 'can update a file by referencing a file extension' do
author_name = @author_data.fetch('author_with_content', 'name')
expect(author_name).to eq 'burt'
 
@author_data.update('author_with_content.md', 'name', 'brian')
Severity: Major
Found in spec/_plugins/author_data_spec.rb and 3 other locations - About 55 mins to fix
spec/_plugins/author_data_spec.rb on lines 51..61
spec/_plugins/author_data_spec.rb on lines 64..74
spec/_plugins/author_data_spec.rb on lines 123..133

Similar blocks of code found in 4 locations. Consider refactoring.
Open

it 'can update a file by referencing a file extension' do
author_name = @author_data.fetch('author', 'name')
expect(author_name).to eq 'aaron'
 
@author_data.update('author.md', 'name', 'brian')
Severity: Major
Found in spec/_plugins/author_data_spec.rb and 3 other locations - About 55 mins to fix
spec/_plugins/author_data_spec.rb on lines 51..61
spec/_plugins/author_data_spec.rb on lines 123..133
spec/_plugins/author_data_spec.rb on lines 136..146

Similar blocks of code found in 4 locations. Consider refactoring.
Open

it 'can update a file without referencing a file extension' do
author_name = @author_data.fetch('author_with_content', 'name')
expect(author_name).to eq 'burt'
 
@author_data.update('author_with_content', 'name', 'brian')
Severity: Major
Found in spec/_plugins/author_data_spec.rb and 3 other locations - About 55 mins to fix
spec/_plugins/author_data_spec.rb on lines 51..61
spec/_plugins/author_data_spec.rb on lines 64..74
spec/_plugins/author_data_spec.rb on lines 136..146

Similar blocks of code found in 4 locations. Consider refactoring.
Open

it 'can update a file without referencing a file extension' do
author_name = @author_data.fetch('author', 'name')
expect(author_name).to eq 'aaron'
 
@author_data.update('author', 'name', 'brian')
Severity: Major
Found in spec/_plugins/author_data_spec.rb and 3 other locations - About 55 mins to fix
spec/_plugins/author_data_spec.rb on lines 64..74
spec/_plugins/author_data_spec.rb on lines 123..133
spec/_plugins/author_data_spec.rb on lines 136..146

Similar blocks of code found in 2 locations. Consider refactoring.
Open

it 'does not update a file if it does not need updating' do
author_name = @author_data.fetch('author_with_content', 'name')
expect(author_name).to eq 'burt'
 
@author_data.update('author_with_content.md', 'name', 'burt')
Severity: Minor
Found in spec/_plugins/author_data_spec.rb and 1 other location - About 25 mins to fix
spec/_plugins/author_data_spec.rb on lines 77..83

Similar blocks of code found in 2 locations. Consider refactoring.
Open

it 'does not update a file if it does not need updating' do
author_name = @author_data.fetch('author', 'name')
expect(author_name).to eq 'aaron'
 
@author_data.update('author.md', 'name', 'aaron')
Severity: Minor
Found in spec/_plugins/author_data_spec.rb and 1 other location - About 25 mins to fix
spec/_plugins/author_data_spec.rb on lines 164..170
Category
Status