ruby/run-basic-rails-application
Vít Ondruch 935a2a0d1d Add support for patch version in Rails
Currently, the test fails with the following error:

~~~
... snip ...

:: [ 17:58:30 ] :: [   PASS   ] :: Creating new rails application (Expected 0, got 0)
:: [ 17:58:30 ] :: [  BEGIN   ] :: Running 'pushd app/'
/tmp/tmp.QUuaPCQMYg/app /tmp/tmp.QUuaPCQMYg /var/ARTIFACTS/work-all5lab20yf/plans/all/discover/default-0/tests/run-basic-rails-application
:: [ 17:58:30 ] :: [   PASS   ] :: Command 'pushd app/' (Expected 0, got 0)
:: [ 17:58:30 ] :: [   PASS   ] :: Directory app should exist
:: [ 17:58:30 ] :: [  BEGIN   ] :: Updating Gemfile to ensure Rails RPM version is used :: actually running 'sed -i.orig -E -e '/^gem "rails"/ s/~> //' Gemfile'
:: [ 17:58:30 ] :: [   PASS   ] :: Updating Gemfile to ensure Rails RPM version is used (Expected 0, got 0)
:: [ 17:58:30 ] :: [  BEGIN   ] :: Printing the Gemfile modifications :: actually running 'diff Gemfile.orig Gemfile'
STDOUT: 4c4
STDOUT: < gem "rails", "~> 8.1.3", ">= 8.1.3.1"
STDOUT: ---
STDOUT: > gem "rails", "8.1.3", ">= 8.1.3.1"
:: [ 17:58:30 ] :: [   PASS   ] :: Printing the Gemfile modifications (Expected 1, got 1)
:: [ 17:58:30 ] :: [  BEGIN   ] :: Installing dependencies specified in Gemfile :: actually running 'bundle install'
Don't run Bundler as root. Installing your bundle as root will break this
application for all non-root users on this machine.
Fetching gem metadata from https://rubygems.org/..........
Local specification for nokogiri-1.19.4 has different dependencies than the remote gem, ignoring it
Local specification for activesupport-8.1.3.1 has different dependencies than the remote gem, ignoring it
Could not find gem 'rails (= 8.1.3, >= 8.1.3.1)' in rubygems repository

... snip ...
~~~

The issue here is that there are two possible variants of `gem "rails"`
depeindency, as can be seen here:

https://github.com/rails/rails/blob/main/railties/lib/rails/generators/app_base.rb#L482-L493

This fixes the test to always end up with the hard dependency, such as:

~~~
gem "rails", "8.1.3.1"
~~~

Resolves: rhbz#2530704
2026-09-09 15:09:01 +02:00
..
main.fmf Require wget, iproute and procps-ng 2024-11-14 10:37:43 +01:00
runtest.sh Add support for patch version in Rails 2026-09-09 15:09:01 +02:00