From 2b6c0d365680c932eaed505749b330ac924d6999 Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Thu, 29 Aug 2024 12:14:28 +0200 Subject: [PATCH] Do not expect file stubs in definitions specs They may be called multiple times and we actually must not care in specs --- spec/dummy/db/schema.rb | 2 +- spec/libraries/page_layout_spec.rb | 4 ++-- spec/models/alchemy/element_spec.rb | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/spec/dummy/db/schema.rb b/spec/dummy/db/schema.rb index 0583e44cb9..676ff4a484 100644 --- a/spec/dummy/db/schema.rb +++ b/spec/dummy/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.1].define(version: 2024_04_11_155901) do +ActiveRecord::Schema[7.2].define(version: 2024_04_11_155901) do create_table "alchemy_attachments", force: :cascade do |t| t.string "name" t.string "file_name" diff --git a/spec/libraries/page_layout_spec.rb b/spec/libraries/page_layout_spec.rb index 1a816c4a2f..9500f13fc9 100644 --- a/spec/libraries/page_layout_spec.rb +++ b/spec/libraries/page_layout_spec.rb @@ -22,8 +22,8 @@ module Alchemy context "with a YAML file including a symbol" do let(:yaml) { "name: :symbol" } before do - expect(File).to receive(:exist?).and_return(true) - expect(File).to receive(:read).and_return(yaml) + allow(File).to receive(:exist?).and_return(true) + allow(File).to receive(:read).and_return(yaml) end it "returns the definition without error" do diff --git a/spec/models/alchemy/element_spec.rb b/spec/models/alchemy/element_spec.rb index bdabd84c56..fb1348073d 100644 --- a/spec/models/alchemy/element_spec.rb +++ b/spec/models/alchemy/element_spec.rb @@ -233,8 +233,8 @@ module Alchemy let(:yaml) { "- name: :symbol" } before do - expect(File).to receive(:exist?).and_return(true) - expect(File).to receive(:read).and_return(yaml) + allow(File).to receive(:exist?).and_return(true) + allow(File).to receive(:read).and_return(yaml) end it "returns the definition without error" do @@ -246,8 +246,8 @@ module Alchemy let(:yaml) { "- default: 2017-12-24" } before do - expect(File).to receive(:exist?).and_return(true) - expect(File).to receive(:read).and_return(yaml) + allow(File).to receive(:exist?).and_return(true) + allow(File).to receive(:read).and_return(yaml) end it "returns the definition without error" do @@ -259,8 +259,8 @@ module Alchemy let(:yaml) { "- format: !ruby/regexp '/\A[^@\s]+@([^@\s]+.)+[^@\s]+\z/'" } before do - expect(File).to receive(:exist?).and_return(true) - expect(File).to receive(:read).and_return(yaml) + allow(File).to receive(:exist?).and_return(true) + allow(File).to receive(:read).and_return(yaml) end it "returns the definition without error" do