Requiring `rspec/core` triggers a warning in the Rails console
Closed this issue · 0 comments
x-yuri commented
Steps to reproduce:
a.sh
:
#!/bin/sh -eux
patch=$1
apk add build-base sqlite-dev nodejs yarn tzdata
gem install rails -v '6.1.4.1'
rails new app
cd app
echo 'gem "rspec-rails", "5.0.2"
gem "db-query-matchers", "0.10.0"' >> Gemfile
bundle
if [ "$patch" ]; then
sed -Ei "s|(require 'rspec/core')|# \1|" \
/usr/local/bundle/gems/db-query-matchers-0.10.0/lib/db_query_matchers/make_database_queries.rb
fi
bin/rails c
$ docker run --rm -itv $PWD/a.sh:/a.sh ruby:2.6-alpine ./a.sh
...
/app # bin/rails c
Loading development environment (Rails 6.1.4.1)
irb: warn: can't alias context from irb_context.
irb(main):001:0>
$ docker run --rm -itv $PWD/a.sh:/a.sh ruby:2.6-alpine ./a.sh patch
...
/app # bin/rails c
Loading development environment (Rails 6.1.4.1)
irb(main):001:0>
This is owing to this line:
Without it it works and my tests pass.