-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove DiscoverReport user params, add Enumeration, basic specs
Updated YARD
- Loading branch information
Showing
3 changed files
with
79 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
require 'rails_helper' | ||
|
||
describe DiscoveryReport do | ||
let(:bundle) { bundle_setup(:proj_revs)} | ||
let(:params) { {} } | ||
subject(:report) { described_class.new(bundle) } | ||
|
||
describe '#initialize' do | ||
it 'raises if PreAssembly::Bundle not received' do | ||
expect { described_class.new }.to raise_error(ArgumentError) | ||
expect { described_class.new({}) }.to raise_error(ArgumentError) | ||
end | ||
it 'accepts PreAssembly::Bundle, performs setup' do | ||
expect(bundle).to receive(:discover_objects) | ||
expect(bundle).to receive(:process_manifest) | ||
expect { described_class.new(bundle) }.not_to raise_error | ||
end | ||
end | ||
|
||
describe '#each_row' do | ||
it 'returns an Enumerable of Hashes' do | ||
expect(report.each_row).to be_an(Enumerable) | ||
end | ||
it 'yields per objects_to_process' do | ||
expect(report).to receive(:per_dobj).with(1).and_return(fake: 1) | ||
expect(report).to receive(:per_dobj).with(2).and_return(fake: 2) | ||
expect(report).to receive(:per_dobj).with(3).and_return(fake: 3) | ||
expect(bundle).to receive(:objects_to_process).and_return([1, 2, 3]) | ||
report.each_row { |_r| } # no-op | ||
end | ||
end | ||
end |