Bump ruby to 3.2.0

pull/11863/head
Christophe Bliard 2 years ago
parent e03cad4ede
commit 3967b051e8
No known key found for this signature in database
GPG Key ID: 2BC07603210C3FA4
  1. 14
      .github/workflows/test-core.yml
  2. 2
      .ruby-version
  3. 5
      Gemfile
  4. 36
      Gemfile.lock
  5. 4
      docker/ci/Dockerfile
  6. 4
      docker/dev/backend/Dockerfile
  7. 4
      docker/prod/Dockerfile
  8. 2
      docs/development/development-environment-docker/README.md
  9. 12
      docs/development/development-environment-osx/README.md
  10. 16
      docs/development/development-environment-ubuntu/README.md
  11. 6
      docs/installation-and-operations/installation/manual/README.md
  12. 2
      lib/tasks/copyright.rake
  13. 2
      lib/tasks/scm.rake
  14. 6
      modules/xls_export/lib/open_project/xls_export/spreadsheet_builder.rb
  15. 4
      spec/lib/open_project/scm/adapters/git_adapter_spec.rb
  16. 10
      spec/lib/open_project/scm/adapters/subversion_adapter_spec.rb
  17. 4
      spec/support/scm/relocate_repository.rb
  18. 2
      spec/workers/scm/create_local_repository_job_spec.rb

@ -33,10 +33,10 @@ jobs:
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
path: /tmp/cache path: /tmp/cache
key: ${{ runner.os }}-ruby31-core-tests-units-${{ hashFiles('**/Gemfile.lock') }} key: ${{ runner.os }}-ruby32-core-tests-units-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: | restore-keys: |
${{ runner.os }}-ruby31-core-tests-units- ${{ runner.os }}-ruby32-core-tests-units-
${{ runner.os }}-ruby31-core-tests- ${{ runner.os }}-ruby32-core-tests-
- name: test - name: test
run: | run: |
docker-compose -f docker-compose.ci.yml build --pull ci docker-compose -f docker-compose.ci.yml build --pull ci
@ -63,10 +63,10 @@ jobs:
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
path: /tmp/cache path: /tmp/cache
key: ${{ runner.os }}-ruby31-core-tests-features-${{ hashFiles('**/Gemfile.lock') }} key: ${{ runner.os }}-ruby32-core-tests-features-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: | restore-keys: |
${{ runner.os }}-ruby31-core-tests-features- ${{ runner.os }}-ruby32-core-tests-features-
${{ runner.os }}-ruby31-core-tests- ${{ runner.os }}-ruby32-core-tests-
- name: test - name: test
run: | run: |
docker-compose -f docker-compose.ci.yml build --pull ci docker-compose -f docker-compose.ci.yml build --pull ci
@ -80,7 +80,7 @@ jobs:
name: APIv3 specification (OpenAPI 3.0) name: APIv3 specification (OpenAPI 3.0)
if: github.repository == 'opf/openproject' if: github.repository == 'opf/openproject'
runs-on: [ubuntu-latest] runs-on: [ubuntu-latest]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1 - uses: ruby/setup-ruby@v1
with: with:

@ -1 +1 @@
3.1.2 3.2.0

@ -28,7 +28,7 @@
source 'https://rubygems.org' source 'https://rubygems.org'
ruby '~> 3.1.2' ruby '~> 3.2.0'
gem 'actionpack-xml_parser', '~> 2.0.0' gem 'actionpack-xml_parser', '~> 2.0.0'
gem 'activemodel-serializers-xml', '~> 1.0.1' gem 'activemodel-serializers-xml', '~> 1.0.1'
@ -181,7 +181,8 @@ gem 'puma', '~> 5.6'
gem 'puma-plugin-statsd', '~> 2.0' gem 'puma-plugin-statsd', '~> 2.0'
gem 'rack-timeout', '~> 0.6.3', require: "rack/timeout/base" gem 'rack-timeout', '~> 0.6.3', require: "rack/timeout/base"
gem 'nokogiri', '~> 1.13.10' # TODO: remove `force_ruby_platform: true` once sparklemotion/nokogiri#2740 is done
gem 'nokogiri', '~> 1.13.10', force_ruby_platform: true
gem 'carrierwave', '~> 1.3.1' gem 'carrierwave', '~> 1.3.1'
gem 'carrierwave_direct', '~> 2.1.0' gem 'carrierwave_direct', '~> 2.1.0'

@ -291,7 +291,7 @@ GEM
awesome_nested_set (3.5.0) awesome_nested_set (3.5.0)
activerecord (>= 4.0.0, < 7.1) activerecord (>= 4.0.0, < 7.1)
aws-eventstream (1.2.0) aws-eventstream (1.2.0)
aws-partitions (1.680.0) aws-partitions (1.684.0)
aws-sdk-core (3.168.4) aws-sdk-core (3.168.4)
aws-eventstream (~> 1, >= 1.0.2) aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.651.0) aws-partitions (~> 1, >= 1.651.0)
@ -392,7 +392,7 @@ GEM
date_validator (0.12.0) date_validator (0.12.0)
activemodel (>= 3) activemodel (>= 3)
activesupport (>= 3) activesupport (>= 3)
debug (1.7.0) debug (1.7.1)
irb (>= 1.5.0) irb (>= 1.5.0)
reline (>= 0.3.1) reline (>= 0.3.1)
deckar01-task_list (2.3.2) deckar01-task_list (2.3.2)
@ -452,7 +452,7 @@ GEM
nokogiri (>= 1.4.3) nokogiri (>= 1.4.3)
erbse (0.1.4) erbse (0.1.4)
temple temple
erubi (1.11.0) erubi (1.12.0)
escape_utils (1.3.0) escape_utils (1.3.0)
et-orbi (1.2.7) et-orbi (1.2.7)
tzinfo tzinfo
@ -464,7 +464,7 @@ GEM
factory_bot_rails (6.2.0) factory_bot_rails (6.2.0)
factory_bot (~> 6.2.0) factory_bot (~> 6.2.0)
railties (>= 5.0.0) railties (>= 5.0.0)
faker (3.0.0) faker (3.1.0)
i18n (>= 1.8.11, < 2) i18n (>= 1.8.11, < 2)
faraday (1.10.2) faraday (1.10.2)
faraday-em_http (~> 1.0) faraday-em_http (~> 1.0)
@ -563,7 +563,7 @@ GEM
ice_cube (0.16.4) ice_cube (0.16.4)
interception (0.5) interception (0.5)
io-console (0.6.0) io-console (0.6.0)
irb (1.6.1) irb (1.6.2)
reline (>= 0.3.0) reline (>= 0.3.0)
iso8601 (0.13.0) iso8601 (0.13.0)
jmespath (1.6.2) jmespath (1.6.2)
@ -587,8 +587,8 @@ GEM
kramdown (~> 2.0) kramdown (~> 2.0)
ladle (1.0.1) ladle (1.0.1)
open4 (~> 1.0) open4 (~> 1.0)
launchy (2.5.0) launchy (2.5.2)
addressable (~> 2.7) addressable (~> 2.8)
lefthook (1.2.6) lefthook (1.2.6)
letter_opener (1.8.1) letter_opener (1.8.1)
launchy (>= 2.2, < 3) launchy (>= 2.2, < 3)
@ -626,7 +626,7 @@ GEM
mime-types-data (3.2022.0105) mime-types-data (3.2022.0105)
mini_magick (4.12.0) mini_magick (4.12.0)
mini_mime (1.1.2) mini_mime (1.1.2)
mini_portile2 (2.8.0) mini_portile2 (2.8.1)
minisyntax (0.2.5) minisyntax (0.2.5)
minitest (5.16.3) minitest (5.16.3)
msgpack (1.6.0) msgpack (1.6.0)
@ -637,7 +637,7 @@ GEM
mustermann-grape (1.0.2) mustermann-grape (1.0.2)
mustermann (>= 1.0.0) mustermann (>= 1.0.0)
nap (1.1.0) nap (1.1.0)
net-imap (0.3.2) net-imap (0.3.4)
date date
net-protocol net-protocol
net-ldap (0.17.1) net-ldap (0.17.1)
@ -730,11 +730,11 @@ GEM
multi_json multi_json
puma (5.6.5) puma (5.6.5)
nio4r (~> 2.0) nio4r (~> 2.0)
puma-plugin-statsd (2.3.0) puma-plugin-statsd (2.4.0)
puma (>= 5.0, < 6) puma (>= 5.0, < 7)
raabro (1.4.0) raabro (1.4.0)
racc (1.6.1) racc (1.6.2)
rack (2.2.4) rack (2.2.5)
rack-accept (0.4.5) rack-accept (0.4.5)
rack (>= 0.4) rack (>= 0.4)
rack-attack (6.6.1) rack-attack (6.6.1)
@ -859,9 +859,9 @@ GEM
rubocop-ast (>= 1.23.0, < 2.0) rubocop-ast (>= 1.23.0, < 2.0)
ruby-progressbar (~> 1.7) ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0) unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.24.0) rubocop-ast (1.24.1)
parser (>= 3.1.1.0) parser (>= 3.1.1.0)
rubocop-rails (2.17.3) rubocop-rails (2.17.4)
activesupport (>= 4.2.0) activesupport (>= 4.2.0)
rack (>= 1.1) rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0) rubocop (>= 1.33.0, < 2.0)
@ -872,7 +872,7 @@ GEM
i18n i18n
iso8601 iso8601
ruby-ole (1.2.12.2) ruby-ole (1.2.12.2)
ruby-prof (1.4.4) ruby-prof (1.4.5)
ruby-progressbar (1.11.0) ruby-progressbar (1.11.0)
ruby-rc4 (0.1.5) ruby-rc4 (0.1.5)
ruby-saml (1.14.0) ruby-saml (1.14.0)
@ -1165,7 +1165,7 @@ DEPENDENCIES
with_advisory_lock (~> 4.6.0) with_advisory_lock (~> 4.6.0)
RUBY VERSION RUBY VERSION
ruby 3.1.2p20 ruby 3.2.0p0
BUNDLED WITH BUNDLED WITH
2.3.12 2.4.1

@ -1,4 +1,4 @@
FROM ruby:3.1.2-buster FROM ruby:3.2.0-buster
MAINTAINER operations@openproject.com MAINTAINER operations@openproject.com
ENV NODE_VERSION="16.17.0" ENV NODE_VERSION="16.17.0"
@ -27,7 +27,7 @@ RUN for url in $CHROME_SOURCE_URL; do \
ENV CI=true ENV CI=true
ENV RAILS_ENV=test ENV RAILS_ENV=test
ENV BUNDLER_VERSION="2.3.12" ENV BUNDLER_VERSION="2.4.1"
ENV BUNDLE_WITHOUT="development:production:docker" ENV BUNDLE_WITHOUT="development:production:docker"
ENV OPENPROJECT_DISABLE_DEV_ASSET_PROXY=1 ENV OPENPROJECT_DISABLE_DEV_ASSET_PROXY=1
ENV CAPYBARA_DYNAMIC_BIND_IP=1 ENV CAPYBARA_DYNAMIC_BIND_IP=1

@ -1,4 +1,4 @@
FROM ruby:3.1.2-bullseye as develop FROM ruby:3.2.0-bullseye as develop
MAINTAINER operations@openproject.com MAINTAINER operations@openproject.com
ARG DEV_UID=1000 ARG DEV_UID=1000
@ -7,7 +7,7 @@ ARG DEV_GID=1001
ENV USER=dev ENV USER=dev
ENV RAILS_ENV=development ENV RAILS_ENV=development
ENV BUNDLER_VERSION "2.3.12" ENV BUNDLER_VERSION "2.4.1"
# `--no-log-init` is required as a workaround to avoid disk exhaustion. # `--no-log-init` is required as a workaround to avoid disk exhaustion.
# #

@ -1,4 +1,4 @@
FROM ruby:3.1.2-buster FROM ruby:3.2.0-buster
MAINTAINER operations@openproject.com MAINTAINER operations@openproject.com
# Allow platform-specific additions. Valid values are: on-prem,saas,bahn # Allow platform-specific additions. Valid values are: on-prem,saas,bahn
@ -8,7 +8,7 @@ ARG GITHUB_OAUTH_TOKEN
ARG DEBIAN_FRONTEND=noninteractive ARG DEBIAN_FRONTEND=noninteractive
ENV NODE_VERSION="16.17.0" ENV NODE_VERSION="16.17.0"
ENV BUNDLER_VERSION="2.3.12" ENV BUNDLER_VERSION="2.4.1"
ENV BUNDLE_PATH__SYSTEM=false ENV BUNDLE_PATH__SYSTEM=false
ENV APP_USER=app ENV APP_USER=app
ENV APP_PATH=/app ENV APP_PATH=/app

@ -186,7 +186,7 @@ When a dependency of the image or the base image itself is changed you may need
Ruby version is updated you may run into an error like the following when running `bin/compose setup`: Ruby version is updated you may run into an error like the following when running `bin/compose setup`:
``` ```
Your Ruby version is 2.7.6, but your Gemfile specified ~> 3.1.2 Your Ruby version is 2.7.6, but your Gemfile specified ~> 3.2.0
``` ```
This means that the current image is out-dated. You can update it like this: This means that the current image is out-dated. You can update it like this:

@ -15,7 +15,7 @@ We'll use [homebrew](https://brew.sh/) to install most of our requirements. Plea
## Install Ruby ## Install Ruby
Use [rbenv](https://github.com/rbenv/rbenv) and [ruby-build](https://github.com/rbenv/ruby-build#readme) to install Ruby. We always require the latest ruby versions, and you can check which version is required by [checking the Gemfile](https://github.com/opf/openproject/blob/dev/Gemfile#L31) for the `ruby "~> X.Y"` statement. At the time of writing, this version is "3.1.2" Use [rbenv](https://github.com/rbenv/rbenv) and [ruby-build](https://github.com/rbenv/ruby-build#readme) to install Ruby. We always require the latest ruby versions, and you can check which version is required by [checking the Gemfile](https://github.com/opf/openproject/blob/dev/Gemfile#L31) for the `ruby "~> X.Y"` statement. At the time of writing, this version is "3.2.0"
### Install rbenv and ruby-build ### Install rbenv and ruby-build
@ -32,20 +32,20 @@ $ rbenv init
### Installing ruby-3.0 ### Installing ruby-3.0
With both installed, we can now install the actual ruby version 3.0. You can check available ruby versions with `rbenv install --list`. With both installed, we can now install the actual ruby version 3.0. You can check available ruby versions with `rbenv install --list`.
At the time of this writing, the latest stable version is `3.1.2`, which we also require. At the time of this writing, the latest stable version is `3.2.0`, which we also require.
We suggest you install the version we require in the [Gemfile](https://github.com/opf/openproject/blob/dev/Gemfile). Search for the `ruby '~> X.Y.Z'` line We suggest you install the version we require in the [Gemfile](https://github.com/opf/openproject/blob/dev/Gemfile). Search for the `ruby '~> X.Y.Z'` line
and install that version. and install that version.
```bash ```bash
# Install the required version as read from the Gemfile # Install the required version as read from the Gemfile
rbenv install 3.1.2 rbenv install 3.2.0
``` ```
This might take a while depending on whether ruby is built from source. After it is complete, you need to tell rbenv to globally activate this version This might take a while depending on whether ruby is built from source. After it is complete, you need to tell rbenv to globally activate this version
```bash ```bash
rbenv global 3.1.2 rbenv global 3.2.0
``` ```
You also need to install [bundler](https://github.com/bundler/bundler/), the ruby gem bundler. You also need to install [bundler](https://github.com/bundler/bundler/), the ruby gem bundler.
@ -116,10 +116,10 @@ You should now have an active ruby and node installation. Verify that it works w
```bash ```bash
$ ruby --version $ ruby --version
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux] ruby 3.2.0 (2022-12-25 revision a528908271) [x86_64-linux]
$ bundler --version $ bundler --version
Bundler version 2.3.12 Bundler version 2.4.1
node --version node --version
v16.17.0 v16.17.0

@ -26,7 +26,7 @@ sudo apt-get install git curl build-essential zlib1g-dev libyaml-dev libssl-dev
## Install Ruby ## Install Ruby
Use [rbenv](https://github.com/rbenv/rbenv) and [ruby-build](https://github.com/rbenv/ruby-build#readme) to install Ruby. We always require the latest ruby versions, and you can check which version is required by [checking the Gemfile](https://github.com/opf/openproject/blob/dev/Gemfile#L31) for the `ruby "~> X.Y"` statement. At the time of writing, this version is "3.1.2" Use [rbenv](https://github.com/rbenv/rbenv) and [ruby-build](https://github.com/rbenv/ruby-build#readme) to install Ruby. We always require the latest ruby versions, and you can check which version is required by [checking the Gemfile](https://github.com/opf/openproject/blob/dev/Gemfile#L31) for the `ruby "~> X.Y"` statement. At the time of writing, this version is "3.2.0"
### Install rbenv and ruby-build ### Install rbenv and ruby-build
@ -57,23 +57,23 @@ ruby-build is an addon to rbenv that installs ruby versions
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
``` ```
### Installing ruby-3.0 ### Installing ruby
With both installed, we can now install the actual ruby version 3.0. You can check available ruby versions with `rbenv install --list`. With both installed, we can now install ruby. You can check available ruby versions with `rbenv install --list`.
At the time of this writing, the latest stable version is `3.1.2` which we also require. At the time of this writing, the latest stable version is `3.2.0` which we also require.
We suggest you install the version we require in the [Gemfile](https://github.com/opf/openproject/blob/dev/Gemfile). Search for the `ruby '~> X.Y.Z'` line We suggest you install the version we require in the [Gemfile](https://github.com/opf/openproject/blob/dev/Gemfile). Search for the `ruby '~> X.Y.Z'` line
and install that version. and install that version.
```bash ```bash
# Install the required version as read from the Gemfile # Install the required version as read from the Gemfile
rbenv install 3.1.2 rbenv install 3.2.0
``` ```
This might take a while depending on whether ruby is built from source. After it is complete, you need to tell rbenv to globally activate this version This might take a while depending on whether ruby is built from source. After it is complete, you need to tell rbenv to globally activate this version
```bash ```bash
rbenv global 3.1.2 rbenv global 3.2.0
rbenv rehash rbenv rehash
``` ```
@ -159,10 +159,10 @@ You should now have an active ruby and node installation. Verify that it works w
```bash ```bash
ruby --version ruby --version
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux] ruby 3.2.0 (2022-12-25 revision a528908271) [x86_64-linux]
bundler --version bundler --version
Bundler version 2.3.12 Bundler version 2.4.1
node --version node --version
v16.13.1 v16.13.1

@ -108,16 +108,16 @@ time to finish.
[openproject@host] source ~/.profile [openproject@host] source ~/.profile
[openproject@host] git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build [openproject@host] git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
[openproject@host] rbenv install 3.1.2 [openproject@host] rbenv install 3.2.0
[openproject@host] rbenv rehash [openproject@host] rbenv rehash
[openproject@host] rbenv global 3.1.2 [openproject@host] rbenv global 3.2.0
``` ```
To check our Ruby installation we run `ruby --version`. It should output To check our Ruby installation we run `ruby --version`. It should output
something very similar to: something very similar to:
``` ```
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux] ruby 3.2.0 (2022-12-25 revision a528908271) [x86_64-linux]
``` ```
## Installation of Node ## Installation of Node

@ -113,7 +113,7 @@ namespace :copyright do
file_list = options[:file_list] || Dir[File.absolute_path(path) + "/**/*.#{ending}"] file_list = options[:file_list] || Dir[File.absolute_path(path) + "/**/*.#{ending}"]
excluded = exluded_paths.concat(additional_excludes) excluded = exluded_paths.concat(additional_excludes)
raise 'Path not found' unless Dir.exists?(path) raise 'Path not found' unless Dir.exist?(path)
file_list.each do |file_name| file_list.each do |file_name|
# Skip 3rd party code # Skip 3rd party code

@ -65,7 +65,7 @@ namespace :scm do
next next
end end
unless Dir.exists?(managed) unless Dir.exist?(managed)
warn "WARNING: Managed repository path set to '#{managed}'," \ warn "WARNING: Managed repository path set to '#{managed}'," \
" but does not exist for SCM vendor #{vendor}!" " but does not exist for SCM vendor #{vendor}!"
next next

@ -131,13 +131,13 @@ module OpenProject::XlsExport
end end
# Add a simple row. This will default to the next row in the sequence. # Add a simple row. This will default to the next row in the sequence.
# Fixnums, Dates and Times are preserved, all other types are converted # Integer, Float, Date, and Time instances are preserved, all other types
# to String as the spreadsheet gem cannot do more formats # are converted to String as the spreadsheet gem cannot do more formats
def add_row(arr, idx = nil) def add_row(arr, idx = nil)
idx ||= [@sheet.last_row_index + 1, 1].max idx ||= [@sheet.last_row_index + 1, 1].max
column_array = [] column_array = []
arr.each_with_index do |c, i| arr.each_with_index do |c, i|
value = if %w(Time Date Fixnum Float Integer).include?(c.class.name) value = if %w(Time Date Float Integer).include?(c.class.name)
c c
elsif c.instance_of?(BigDecimal) elsif c.instance_of?(BigDecimal)
c.to_f c.to_f

@ -88,7 +88,7 @@ describe OpenProject::SCM::Adapters::Git do
describe 'invalid repository' do describe 'invalid repository' do
describe '.check_availability!' do describe '.check_availability!' do
it 'is not available' do it 'is not available' do
expect(Dir.exists?(url)).to be false expect(Dir.exist?(url)).to be false
expect(adapter).not_to be_available expect(adapter).not_to be_available
expect { adapter.check_availability! } expect { adapter.check_availability! }
.to raise_error(OpenProject::SCM::Exceptions::SCMUnavailable) .to raise_error(OpenProject::SCM::Exceptions::SCMUnavailable)
@ -155,7 +155,7 @@ describe OpenProject::SCM::Adapters::Git do
end end
it 'is a valid repository' do it 'is a valid repository' do
expect(Dir.exists?(repo_dir)).to be true expect(Dir.exist?(repo_dir)).to be true
out, process = Open3.capture2e('git', '--git-dir', repo_dir, 'branch') out, process = Open3.capture2e('git', '--git-dir', repo_dir, 'branch')
expect(process.exitstatus).to eq(0) expect(process.exitstatus).to eq(0)

@ -72,7 +72,7 @@ describe OpenProject::SCM::Adapters::Subversion do
describe 'invalid repository' do describe 'invalid repository' do
describe '.check_availability!' do describe '.check_availability!' do
it 'is not available' do it 'is not available' do
expect(Dir.exists?(url)).to be false expect(Dir.exist?(url)).to be false
expect(adapter).not_to be_available expect(adapter).not_to be_available
expect { adapter.check_availability! } expect { adapter.check_availability! }
.to raise_error(OpenProject::SCM::Exceptions::SCMUnavailable) .to raise_error(OpenProject::SCM::Exceptions::SCMUnavailable)
@ -133,11 +133,11 @@ describe OpenProject::SCM::Adapters::Subversion do
describe '.create_empty_svn' do describe '.create_empty_svn' do
context 'with valid root_url' do context 'with valid root_url' do
it 'creates the repository' do it 'creates the repository' do
expect(Dir.exists?(root_url)).to be true expect(Dir.exist?(root_url)).to be true
expect(Dir.entries(root_url).length).to eq 2 expect(Dir.entries(root_url).length).to eq 2
expect { adapter.create_empty_svn }.not_to raise_error expect { adapter.create_empty_svn }.not_to raise_error
expect(Dir.exists?(root_url)).to be true expect(Dir.exist?(root_url)).to be true
expect(Dir.entries(root_url).length).to be >= 5 expect(Dir.entries(root_url).length).to be >= 5
end end
end end
@ -149,7 +149,7 @@ describe OpenProject::SCM::Adapters::Subversion do
expect { adapter.create_empty_svn } expect { adapter.create_empty_svn }
.to raise_error(OpenProject::SCM::Exceptions::CommandFailed) .to raise_error(OpenProject::SCM::Exceptions::CommandFailed)
expect(Dir.exists?(root_url)).to be false expect(Dir.exist?(root_url)).to be false
end end
end end
end end
@ -172,7 +172,7 @@ describe OpenProject::SCM::Adapters::Subversion do
end end
it 'is a valid repository' do it 'is a valid repository' do
expect(Dir.exists?(repo_dir)).to be true expect(Dir.exist?(repo_dir)).to be true
out, process = Open3.capture2e('svn', 'info', url) out, process = Open3.capture2e('svn', 'info', url)
expect(process.exitstatus).to eq(0) expect(process.exitstatus).to eq(0)

@ -26,7 +26,7 @@ shared_examples_for 'repository can be relocated' do |vendor|
it 'relocates when project identifier is updated' do it 'relocates when project identifier is updated' do
current_path = repository.root_url current_path = repository.root_url
expect(repository.root_url).to eq(repository.managed_repository_path) expect(repository.root_url).to eq(repository.managed_repository_path)
expect(Dir.exists?(repository.managed_repository_path)).to be true expect(Dir.exist?(repository.managed_repository_path)).to be true
# Rename the project # Rename the project
project.update!(identifier: 'somenewidentifier') project.update!(identifier: 'somenewidentifier')
@ -39,7 +39,7 @@ shared_examples_for 'repository can be relocated' do |vendor|
expect(current_path).not_to eq(repository.root_url) expect(current_path).not_to eq(repository.root_url)
expect(repository.url).to eq(repository.managed_repository_url) expect(repository.url).to eq(repository.managed_repository_url)
expect(Dir.exists?(repository.managed_repository_path)).to be true expect(Dir.exist?(repository.managed_repository_path)).to be true
end end
end end

@ -62,7 +62,7 @@ describe SCM::CreateLocalRepositoryJob do
shared_examples 'creates a directory with mode' do |expected| shared_examples 'creates a directory with mode' do |expected|
it 'creates the directory' do it 'creates the directory' do
subject subject
expect(Dir.exists?(repository.root_url)).to be true expect(Dir.exist?(repository.root_url)).to be true
file_mode = File.stat(repository.root_url).mode file_mode = File.stat(repository.root_url).mode
expect(sprintf("%o", file_mode)).to end_with(expected) expect(sprintf("%o", file_mode)).to end_with(expected)

Loading…
Cancel
Save