Add RSpec 4 compatibility (#17652)

* Remove outdated option

04078317ba

* Use the non-globally exposed RSpec syntax

https://github.com/rspec/rspec-core/pull/2803

* Use the non-globally exposed RSpec syntax, cont

https://github.com/rspec/rspec-core/pull/2803

* Comply to strict predicate matchers

See:
 - https://github.com/rspec/rspec-expectations/pull/1195
 - https://github.com/rspec/rspec-expectations/pull/1196
 - https://github.com/rspec/rspec-expectations/pull/1277
This commit is contained in:
Phil Pirozhkov
2022-07-28 05:27:38 +03:00
committed by GitHub
parent 72b24f3fb9
commit 493d437e79
736 changed files with 781 additions and 782 deletions

View File

@@ -17,7 +17,7 @@ def grep_file(file, regex)
lines.count > 0 ? file : nil
end
describe 'Coding style' do
RSpec.describe 'Coding style' do
describe 'Javascript' do
it 'prevents this.get("foo") pattern' do
js_files = list_js_files('app/assets/javascripts')

View File

@@ -1,5 +1,5 @@
# frozen_string_literal: true
describe "CommonMark" do
RSpec.describe "CommonMark" do
it 'passes spec' do
SiteSetting.traditional_markdown_linebreaks = true

View File

@@ -20,7 +20,7 @@ def is_yaml_compatible?(english, translated)
true
end
describe "i18n integrity checks" do
RSpec.describe "i18n integrity checks" do
it "has an i18n key for each Site Setting" do
SiteSetting.all_settings.each do |s|
next if s[:setting][/^test_/]
@@ -97,7 +97,7 @@ describe "i18n integrity checks" do
end
end
describe "fallbacks" do
RSpec.describe "fallbacks" do
before do
I18n.backend = I18n::Backend::DiscourseI18n.new
I18n.fallbacks = I18n::Backend::FallbackLocaleList.new

View File

@@ -1,6 +1,6 @@
# frozen_string_literal: true
describe "constants match ruby" do
RSpec.describe "constants match ruby" do
let(:ctx) { MiniRacer::Context.new }

View File

@@ -1,6 +1,6 @@
# frozen_string_literal: true
describe 'Oj' do
RSpec.describe 'Oj' do
it "is enabled" do
classes = Set.new
tracer = TracePoint.new(:c_call) { |tp| classes << tp.defined_class }

View File

@@ -1,6 +1,6 @@
# frozen_string_literal: true
describe ::Jobs::Onceoff do
RSpec.describe ::Jobs::Onceoff do
it "can run all once off jobs without errors" do
# Load all once offs
Dir[Rails.root + 'app/jobs/onceoff/*.rb'].each do |f|

View File

@@ -1,6 +1,6 @@
# frozen_string_literal: true
describe "site setting integrity checks" do
RSpec.describe "site setting integrity checks" do
let(:site_setting_file) { File.join(Rails.root, 'config', 'site_settings.yml') }
let(:yaml) { YAML.load_file(site_setting_file) }