Skip to content

Commit 748032c

Browse files
authored
Merge pull request #64 from rspec/update-ubuntu-runner
Update ubuntu runner
2 parents 8e18b84 + d98ebce commit 748032c

File tree

5 files changed

+19
-9
lines changed

5 files changed

+19
-9
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ concurrency:
1818
jobs:
1919
rubocop:
2020
name: Rubocop
21-
runs-on: 'ubuntu-20.04'
21+
runs-on: 'ubuntu-latest'
2222
steps:
2323
- uses: actions/checkout@v4
2424
- uses: ruby/setup-ruby@v1
@@ -30,7 +30,7 @@ jobs:
3030

3131
test:
3232
name: 'Ruby: ${{ matrix.ruby }}, Rails: ${{ matrix.env.RAILS_VERSION }}'
33-
runs-on: ubuntu-20.04
33+
runs-on: 'ubuntu-latest'
3434
strategy:
3535
fail-fast: false
3636
matrix:
@@ -213,7 +213,7 @@ jobs:
213213

214214
legacy:
215215
name: Legacy Ruby Builds (${{ matrix.container.version }})
216-
runs-on: ubuntu-20.04
216+
runs-on: 'ubuntu-latest'
217217
container:
218218
image: ${{ matrix.container.tag }}
219219
options: ${{ matrix.container.options || '--add-host github-complains-if-this-is-empty.com:127.0.0.1' }}
@@ -225,7 +225,6 @@ jobs:
225225
- container:
226226
version: "2.1.9"
227227
tag: ghcr.io/rspec/docker-ci:2.1.9
228-
post: git config --global --add safe.directory `pwd`
229228
env:
230229
RAILS_VERSION: '~> 4.2.0'
231230
- container:
@@ -240,14 +239,16 @@ jobs:
240239
RAILS_VERSION: '~> 4.2.0'
241240

242241
env:
243-
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
244242
LEGACY_CI: true
245243
JRUBY_OPTS: ${{ matrix.container.jruby_opts || '--dev' }}
246244
RAILS_VERSION: ${{ matrix.env.RAILS_VERSION }}
247245
steps:
248-
- uses: actions/checkout@v3
246+
- run: git config --global --add safe.directory $GITHUB_WORKSPACE
247+
- run: git init $GITHUB_WORKSPACE
248+
- run: git remote add origin https://github.com/rspec/rspec-activemodel-mocks
249+
- run: git config --local gc.auto 0
250+
- run: git fetch --no-tags --prune --no-recurse-submodules --depth=1 origin +$GITHUB_SHA:$GITHUB_REF
251+
- run: git checkout --progress --force $GITHUB_REF
249252
- run: apt-get install libsqlite3-dev
250-
- run: ${{ matrix.container.pre }}
251253
- run: script/legacy_setup.sh
252-
- run: ${{ matrix.container.post }}
253254
- run: script/run_build

Gemfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ end
3737
version = ENV.fetch('RAILS_VERSION', '6.0.0')
3838
version_float = version.tr('-', '.').tr('~> ', '').to_f
3939

40+
if version_float < 7.1
41+
gem 'concurrent-ruby', '<= 1.3.4'
42+
end
43+
4044
if version_float < 4
4145
gem 'sqlite3', '~> 1.3.5'
4246
elsif version_float < 6

lib/rspec/active_model/mocks/mocks.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,11 @@ def self.param_delimiter; "-"; end
176176
end unless stubs.key?(:has_attribute?)
177177

178178
msingleton.__send__(:define_method, :respond_to?) do |method_name, *args|
179+
return true if __model_class_has_column?(method_name)
180+
179181
include_private = args.first || false
180-
__model_class_has_column?(method_name) ? true : super(method_name, include_private)
182+
183+
super(method_name, include_private)
181184
end unless stubs.key?(:respond_to?)
182185

183186
msingleton.__send__(:define_method, :method_missing) do |missing_m, *a, &b|

spec/spec_helper.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# frozen_string_literal: true
2+
require 'logger'
23
require 'rspec/active_model/mocks'
34
require 'active_record'
45

templates/sample/spec/spec_helper.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# frozen_string_literal: true
22
$:<< File.join(File.dirname(__FILE__), '..')
3+
require 'logger'
34
require 'active_record'
45
require 'rspec/active_model/mocks'
56
require 'model/widget'

0 commit comments

Comments
 (0)