Skip to content

Commit 1cb2d61

Browse files
committed
Diffy test
1 parent 3e2add6 commit 1cb2d61

3 files changed

Lines changed: 16 additions & 0 deletions

File tree

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ source 'https://rubygems.org'
55
ruby '>= 3.2', '< 3.5'
66

77
group :test, :development do
8+
gem 'diffy', '~> 3.4'
89
gem 'heroku_hatchet'
910
gem 'java-properties'
1011
# Work around https://github.com/excon/excon/issues/860

Gemfile.lock

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ GEM
44
ast (2.4.3)
55
base64 (0.3.0)
66
diff-lcs (1.6.2)
7+
diffy (3.4.4)
78
erubis (2.7.0)
89
excon (1.2.7)
910
logger
@@ -82,6 +83,7 @@ PLATFORMS
8283
ruby
8384

8485
DEPENDENCIES
86+
diffy (~> 3.4)
8587
heroku_hatchet
8688
java-properties
8789
logger

test/spec/versions_spec.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# frozen_string_literal: true
22

33
require_relative 'spec_helper'
4+
require 'diffy'
45

56
RSpec.describe 'Maven buildpack' do
67
it 'runs Maven wrapper instead of installing Maven when possible' do
@@ -34,6 +35,18 @@
3435
add_to_system_properties('maven.version', UNKNOWN_MAVEN_VERSION)
3536
end
3637

38+
a = <<~OUTPUT
39+
remote: -----> Installing Maven #{UNKNOWN_MAVEN_VERSION}...
40+
remote:
41+
remote: ! ERROR: You have defined an unsupported Maven version in the system.properties file.
42+
remote: !
43+
remote: ! The default supported version is #{DEFAULT_MAVEN_VERSION}
44+
remote:
45+
remote: ! Push rejected, failed to compile Java app.
46+
OUTPUT
47+
48+
warn(Diffy::Diff.new(clean_output(app.output), a).to_s(:html))
49+
3750
app.deploy do
3851
expect(clean_output(app.output)).to include(<<~OUTPUT)
3952
remote: -----> Installing Maven #{UNKNOWN_MAVEN_VERSION}...

0 commit comments

Comments
 (0)