Skip to content

Commit

Permalink
C2M assigns actual_version to AuditResults once known
Browse files Browse the repository at this point in the history
  • Loading branch information
ndushay committed Jan 31, 2018
1 parent b6fd28a commit 939451b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions lib/audit/catalog_to_moab.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def check_catalog_version
end

moab_version = moab.current_version_id
results.actual_version = moab_version
catalog_version = preserved_copy.version
if catalog_version == moab_version
results.add_result(AuditResults::VERSION_MATCHES, preserved_copy.class.name)
Expand Down
12 changes: 6 additions & 6 deletions spec/lib/audit/catalog_to_moab_instance_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
end

it 'calls POHandlerResults.report_results' do
pohandler_results = instance_double(AuditResults, add_result: nil)
pohandler_results = instance_double(AuditResults, add_result: nil, :actual_version= => nil)
allow(AuditResults).to receive(:new).and_return(pohandler_results)
expect(pohandler_results).to receive(:report_results)
c2m.check_catalog_version
Expand Down Expand Up @@ -103,7 +103,7 @@

context 'catalog version == moab version (happy path)' do
it 'adds a VERSION_MATCHES result' do
pohandler_results = instance_double(AuditResults, report_results: nil)
pohandler_results = instance_double(AuditResults, report_results: nil, :actual_version= => nil)
allow(AuditResults).to receive(:new).and_return(pohandler_results)
expect(pohandler_results).to receive(:add_result).with(
AuditResults::VERSION_MATCHES, 'PreservedCopy'
Expand All @@ -120,7 +120,7 @@
end

it 'adds an UNEXPECTED_VERSION result' do
pohandler_results = instance_double(AuditResults, report_results: nil)
pohandler_results = instance_double(AuditResults, report_results: nil, :actual_version= => nil)
expect(pohandler_results).to receive(:add_result).with(
AuditResults::UNEXPECTED_VERSION, 'PreservedCopy'
)
Expand All @@ -144,7 +144,7 @@
end

it 'adds an UNEXPECTED_VERSION result' do
pohandler_results = instance_double(AuditResults, report_results: nil)
pohandler_results = instance_double(AuditResults, report_results: nil, :actual_version= => nil)
expect(pohandler_results).to receive(:add_result).with(
AuditResults::UNEXPECTED_VERSION, 'PreservedCopy'
)
Expand Down Expand Up @@ -180,7 +180,7 @@
expect(new_status).to eq PreservedCopy::INVALID_MOAB_STATUS
end
it 'adds an INVALID_MOAB result' do
pohandler_results = instance_double(AuditResults, report_results: nil)
pohandler_results = instance_double(AuditResults, report_results: nil, :actual_version= => nil)
expect(pohandler_results).to receive(:add_result).with(
AuditResults::INVALID_MOAB, anything
)
Expand All @@ -190,7 +190,7 @@
end
end
it 'adds a PC_STATUS_CHANGED result' do
pohandler_results = instance_double(AuditResults, report_results: nil)
pohandler_results = instance_double(AuditResults, report_results: nil, :actual_version= => nil)
expect(pohandler_results).to receive(:add_result).with(
AuditResults::PC_STATUS_CHANGED, a_hash_including(:old_status, :new_status)
)
Expand Down

0 comments on commit 939451b

Please sign in to comment.