Skip to content
This repository has been archived by the owner on Apr 6, 2021. It is now read-only.

Commit

Permalink
Add nocov surrounds to fixtures, add notes to some tests.
Browse files Browse the repository at this point in the history
There are some tests that need some serious attention before moving too
far forward from here.
  • Loading branch information
nathankleyn committed Jan 20, 2015
1 parent 2b9db68 commit 7f49d08
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
8 changes: 4 additions & 4 deletions spec/lib/shanty/discoverer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
# All classes referenced belong to the shanty project
module Shanty
RSpec.describe Shanty::Discoverer do
let(:discoverers) do
Discoverer.discoverers
end
let(:discoverers) { Discoverer.discoverers }

describe '#discoervers' do
describe '#discoverers' do
it 'finds all discoverers' do
# FIXME: This is not a good test. This could break any time anything requires in another discoverer.
# We should instead inspect that it contains a discoverer that we create and require within this test.
expect(discoverers).to contain_exactly(Shanty::ShantyfileDiscoverer)
expect(discoverers.size).to be == 1
end
Expand Down
5 changes: 5 additions & 0 deletions spec/lib/shanty/graph_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ module Shanty
File.join(root, 'examples', 'test-static-project')
]
end

# We don't want the creation of the project templates to affect coverage here.
# :nocov:
let(:project_templates) { project_paths.map { |project_path| ProjectTemplate.new(root, project_path) } }
# :nocov:

let(:graph) { Graph.new(project_templates) }

describe 'enumerable methods' do
Expand Down
12 changes: 6 additions & 6 deletions spec/lib/shanty/shanty_file_discoverer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@

# All classes referenced belong to the shanty project
module Shanty
RSpec.describe Shanty::ShantyfileDiscoverer do
let(:project_templates) do
Dir.chdir('examples') do
ShantyfileDiscoverer.new.discover
end
end
RSpec.describe(Shanty::ShantyfileDiscoverer) do
let(:project1) { 'test-static-project' }
let(:project2) { 'test-static-project-2' }
let(:project3) { 'test-static-project-3' }
Expand All @@ -22,6 +17,11 @@ module Shanty
File.join(Dir.pwd, 'examples', project2, project3)
]
end
let(:project_templates) do
Dir.chdir('examples') do
ShantyfileDiscoverer.new.discover
end
end

describe '#discovered' do
it 'finds example projects' do
Expand Down

0 comments on commit 7f49d08

Please sign in to comment.