Skip to content

Commit 7f0c6c9

Browse files
authored
Merge pull request #2362 from rspec/minor-improvements
Minor improvements
2 parents 6fcce4c + c75b172 commit 7f0c6c9

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

Rakefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ namespace :generate do
6363
# Rails 4+ cannot use a `rails` binstub generated by Bundler
6464
sh "rm -f #{bindir}/rails"
6565
sh "bundle exec rails new ./tmp/example_app --no-rc --skip-javascript --skip-bootsnap --skip-sprockets " \
66-
"--skip-git --skip-test-unit --skip-listen --skip-bundle --template=example_app_generator/generate_app.rb"
66+
"--skip-git --skip-test-unit --skip-listen --skip-bundle --skip-spring " \
67+
"--template=example_app_generator/generate_app.rb"
6768

6869
in_example_app do
6970
sh "./travis_retry_bundle_install.sh 2>&1"
@@ -189,7 +190,8 @@ namespace :no_active_record do
189190
# Rails 4+ cannot use a `rails` binstub generated by Bundler
190191
sh "rm -f #{bindir}/rails"
191192
sh "bundle exec rails new #{example_app_dir} --no-rc --skip-active-record --skip-javascript --skip-bootsnap " \
192-
"--skip-sprockets --skip-git --skip-test-unit --skip-listen --skip-bundle --template=example_app_generator/generate_app.rb"
193+
"--skip-sprockets --skip-git --skip-test-unit --skip-listen --skip-bundle --skip-spring " \
194+
"--template=example_app_generator/generate_app.rb"
193195

194196
in_example_app(app_dir: example_app_dir) do
195197
sh "./travis_retry_bundle_install.sh 2>&1"

script/update_rubygems_and_install_bundler

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ if is_ruby_23_plus; then
1010
gem install --no-document bundler
1111
else
1212
echo "Warning installing older versions of Rubygems / Bundler"
13-
gem update --system '2.7.8'
13+
gem update --system '2.7.10'
1414
gem install bundler -v '1.17.3'
1515
fi

spec/rspec/rails/example/view_example_group_spec.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,15 +247,18 @@ def _view; end # Stub method
247247
pending_only_on_ruby_22_rails_52 = false
248248
end
249249

250-
it 'is accessible to hooks', pending: pending_only_on_ruby_22_rails_52 do
250+
# Regression test from rspec/rspec-rails#833
251+
it 'is accessible to configuration-level hooks', pending: pending_only_on_ruby_22_rails_52 do
251252
with_isolated_config do
252253
run_count = 0
253254
RSpec.configuration.before(:each, type: :view) do
255+
# `view` is provided from the view example type, and serves to
256+
# demonstrate this hook is run in the correct context.
254257
allow(view).to receive(:render) { :value }
255258
run_count += 1
256259
end
257260
group = RSpec::Core::ExampleGroup.describe 'a view', type: :view do
258-
specify { expect(true).to eq true }
261+
specify { expect(view.render).to eq(:value) }
259262
end
260263
group.run(failure_reporter)
261264
expect(failure_reporter.exceptions).to eq []

0 commit comments

Comments
 (0)