|
1 | 1 | # frozen_string_literal: true |
2 | 2 |
|
3 | 3 | require_relative 'spec_helper' |
| 4 | +require 'diffy' |
4 | 5 |
|
5 | 6 | RSpec.describe 'Maven buildpack' do |
6 | 7 | it 'runs Maven wrapper instead of installing Maven when possible' do |
|
35 | 36 | end |
36 | 37 |
|
37 | 38 | app.deploy do |
38 | | - expect(clean_output(app.output)).to include(<<~OUTPUT) |
| 39 | + a = <<~OUTPUT |
39 | 40 | remote: -----> Installing Maven #{UNKNOWN_MAVEN_VERSION}... |
40 | 41 | remote: |
41 | 42 | remote: ! ERROR: You have defined an unsupported Maven version in the system.properties file. |
42 | 43 | remote: ! |
43 | 44 | remote: ! The default supported version is #{DEFAULT_MAVEN_VERSION} |
| 45 | + remote: |
| 46 | + remote: ! Push rejected, failed to compile Java app. |
| 47 | + OUTPUT |
| 48 | + |
| 49 | + expect(Diffy::Diff.new(clean_output(app.output), a).to_s(:html)).to include('nothing') |
| 50 | + |
| 51 | + expect(clean_output(app.output)).to include(<<~OUTPUT) |
| 52 | + remote: -----> Installing Maven #{UNKNOWN_MAVEN_VERSION}... |
44 | 53 | remote: |
| 54 | + remote: ! ERROR: You have defined an unsupported Maven version in the system.properties file. |
| 55 | + remote: ! |
| 56 | + remote: ! The default supported version is #{DEFAULT_MAVEN_VERSION} |
| 57 | + remote: |
45 | 58 | remote: ! Push rejected, failed to compile Java app. |
46 | 59 | OUTPUT |
47 | 60 | end |
|
70 | 83 | end |
71 | 84 |
|
72 | 85 | app.deploy do |
| 86 | + a = <<~OUTPUT |
| 87 | + remote: -----> Installing Maven #{UNKNOWN_MAVEN_VERSION}... |
| 88 | + remote: |
| 89 | + remote: ! ERROR: You have defined an unsupported Maven version in the system.properties file. |
| 90 | + remote: ! |
| 91 | + remote: ! The default supported version is #{DEFAULT_MAVEN_VERSION} |
| 92 | + remote: |
| 93 | + remote: ! Push rejected, failed to compile Java app. |
| 94 | + OUTPUT |
| 95 | + |
| 96 | + expect(Diffy::Diff.new(clean_output(app.output), a).to_s(:html)).to include('nothing') |
| 97 | + |
73 | 98 | expect(clean_output(app.output)).to include(<<~OUTPUT) |
74 | 99 | remote: -----> Installing Maven #{UNKNOWN_MAVEN_VERSION}... |
75 | 100 | remote: ! ERROR: You have defined an unsupported Maven version in the system.properties file. |
|
0 commit comments