Skip to content

Commit

Permalink
Do not expect file stubs in definitions specs
Browse files Browse the repository at this point in the history
They may be called multiple times and we actually must not care in specs
  • Loading branch information
tvdeyen committed Aug 29, 2024
1 parent ff0141a commit 2b6c0d3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion spec/dummy/db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions spec/libraries/page_layout_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions spec/models/alchemy/element_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 2b6c0d3

Please sign in to comment.