From b184619b93eddba76d214b7ecd5d5a5582f07e80 Mon Sep 17 00:00:00 2001 From: Mostafa Ahangarha Date: Wed, 6 Mar 2024 11:56:13 +0330 Subject: [PATCH] Autofix rubocop issues --- .../generators/dev_tests_generator_spec.rb | 12 ++++++------ .../generators/install_generator_spec.rb | 2 +- .../react_no_redux_generator_examples.rb | 4 ++-- .../react_with_redux_generator_examples.rb | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/spec/react_on_rails/generators/dev_tests_generator_spec.rb b/spec/react_on_rails/generators/dev_tests_generator_spec.rb index 874425241..5a100a5db 100644 --- a/spec/react_on_rails/generators/dev_tests_generator_spec.rb +++ b/spec/react_on_rails/generators/dev_tests_generator_spec.rb @@ -25,16 +25,16 @@ it "changes package.json to use local react-on-rails version of module" do assert_file("package.json") do |contents| - assert_match('"react-on-rails"', contents) - assert_match('"postinstall"', contents) + expect(contents).to match('"react-on-rails"') + expect(contents).to match('"postinstall"') end end it "adds test-related gems to Gemfile" do assert_file("Gemfile") do |contents| - assert_match("gem \"rspec-rails\", group: :test", contents) - assert_match("gem \"coveralls\", require: false", contents) - assert_match("gem \"chromedriver-helper\", group: :test", contents) + expect(contents).to match("gem \"rspec-rails\", group: :test") + expect(contents).to match("gem \"coveralls\", require: false") + expect(contents).to match("gem \"chromedriver-helper\", group: :test") end end end @@ -49,7 +49,7 @@ it "adds prerender for examples with example-server-rendering" do assert_file("app/views/hello_world/index.html.erb") do |contents| - assert_match("prerender: true", contents) + expect(contents).to match("prerender: true") end end end diff --git a/spec/react_on_rails/generators/install_generator_spec.rb b/spec/react_on_rails/generators/install_generator_spec.rb index a380112ce..8e3c082aa 100644 --- a/spec/react_on_rails/generators/install_generator_spec.rb +++ b/spec/react_on_rails/generators/install_generator_spec.rb @@ -45,7 +45,7 @@ it "adds ReactOnRails::TestHelper.configure_rspec_to_compile_assets(config)" do expected = ReactOnRails::Generators::BaseGenerator::CONFIGURE_RSPEC_TO_COMPILE_ASSETS - assert_file("spec/rails_helper.rb") { |contents| assert_match(expected, contents) } + assert_file("spec/rails_helper.rb") { |contents| expect(contents).to match(expected) } end end diff --git a/spec/react_on_rails/support/shared_examples/react_no_redux_generator_examples.rb b/spec/react_on_rails/support/shared_examples/react_no_redux_generator_examples.rb index d9c0cff85..7c011600e 100644 --- a/spec/react_on_rails/support/shared_examples/react_no_redux_generator_examples.rb +++ b/spec/react_on_rails/support/shared_examples/react_no_redux_generator_examples.rb @@ -3,11 +3,11 @@ shared_examples "no_redux_generator" do it "creates appropriate templates" do assert_file("app/javascript/packs/hello-world-bundle.js") do |contents| - assert_match("import HelloWorld from '../bundles/HelloWorld/components/HelloWorld';", contents) + expect(contents).to match("import HelloWorld from '../bundles/HelloWorld/components/HelloWorld';") end assert_file("app/views/hello_world/index.html.erb") do |contents| - assert_match(/"HelloWorld"/, contents) + expect(contents).to match(/"HelloWorld"/) end end diff --git a/spec/react_on_rails/support/shared_examples/react_with_redux_generator_examples.rb b/spec/react_on_rails/support/shared_examples/react_with_redux_generator_examples.rb index a4ba57287..7993c0632 100644 --- a/spec/react_on_rails/support/shared_examples/react_with_redux_generator_examples.rb +++ b/spec/react_on_rails/support/shared_examples/react_with_redux_generator_examples.rb @@ -7,10 +7,10 @@ it "creates appropriate templates" do assert_file("app/javascript/packs/hello-world-bundle.js") do |contents| - assert_match("import HelloWorldApp from '../bundles/HelloWorld/startup/HelloWorldApp';", contents) + expect(contents).to match("import HelloWorldApp from '../bundles/HelloWorld/startup/HelloWorldApp';") end assert_file("app/views/hello_world/index.html.erb") do |contents| - assert_match(/"HelloWorldApp"/, contents) + expect(contents).to match(/"HelloWorldApp"/) end end