diff options
Diffstat (limited to 'spec/scripts/lib/glfm/verify_all_generated_files_are_up_to_date_spec.rb')
-rw-r--r-- | spec/scripts/lib/glfm/verify_all_generated_files_are_up_to_date_spec.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/spec/scripts/lib/glfm/verify_all_generated_files_are_up_to_date_spec.rb b/spec/scripts/lib/glfm/verify_all_generated_files_are_up_to_date_spec.rb index fca037c9ff3..c678565fe90 100644 --- a/spec/scripts/lib/glfm/verify_all_generated_files_are_up_to_date_spec.rb +++ b/spec/scripts/lib/glfm/verify_all_generated_files_are_up_to_date_spec.rb @@ -9,8 +9,8 @@ require_relative '../../../../scripts/lib/glfm/verify_all_generated_files_are_up RSpec.describe Glfm::VerifyAllGeneratedFilesAreUpToDate, '#process' do subject { described_class.new } - let(:output_path) { described_class::GLFM_SPEC_OUTPUT_PATH } - let(:snapshots_path) { described_class::EXAMPLE_SNAPSHOTS_PATH } + let(:output_path) { described_class::GLFM_OUTPUT_SPEC_PATH } + let(:snapshots_path) { described_class::ES_OUTPUT_EXAMPLE_SNAPSHOTS_PATH } let(:verify_cmd) { "git status --porcelain #{output_path} #{snapshots_path}" } before do @@ -52,10 +52,13 @@ RSpec.describe Glfm::VerifyAllGeneratedFilesAreUpToDate, '#process' do before do # Simulate a clean repo, then simulate changes to generated files allow(subject).to receive(:run_external_cmd).twice.with(verify_cmd).and_return('', "M #{snapshots_path}") + allow(subject).to receive(:run_external_cmd).with('git diff') + allow(subject).to receive(:warn).and_call_original end it 'raises an error', :unlimited_max_formatted_output_length do - expect { subject.process }.to raise_error(/following files were modified.*#{snapshots_path}/m) + expect(subject).to receive(:warn).with(/following files were modified.*#{snapshots_path}/m) + expect { subject.process }.to raise_error(/The generated files are not up to date/) end end end |